# jinang

> Collection of Node.js / ECMAScript Gists

Latest version **0.26.1** (published 2020-01-05) · 0 weekly downloads

## Install

```sh
npm install jinang
pnpm add jinang
yarn add jinang
bun add jinang
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.26.1 |
| Published | 2020-01-05 |
| First published | 2017-11-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Unpacked size | 108.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | YounGoat |
| Maintainers | youngoat, youngoat.elite |
| Keywords | clone, cocurrency, currying, customise-error, directory, echo-off, for-in-object, for-of-object, is-generator, is-generator-function, concatenate-string, json-file, modify-url, url, open, open-url, open-repository, ordinal-number, once, twice, thrice, papply, parse-option, promise-or-callback, progress, unhandled-promise-rejection, safe-clone, shorten-text, sleep, set-into-object, get-from-object, split, print-table-in-console, txt-file, uncolors, unescaping |

## Links

- npm: https://www.npmjs.com/package/jinang
- Repository: https://github.com/YounGoat/jinang
- Issues: https://github.com/YounGoat/jinang/issues
- npm.io page: https://npm.io/package/jinang

## Dependencies (1)

- [noda](https://npm.io/package/noda.md) ^0.1.2

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 0.26.1 (latest) — 2020-01-05
- 0.26.0 — 2019-05-19
- 0.25.0 — 2019-03-08
- 0.24.0 — 2019-02-28
- 0.23.0 — 2019-01-28
- 0.22.0 — 2018-05-13
- 0.21.0 — 2018-04-23
- 0.20.0 — 2018-04-09
- 0.19.0 — 2018-04-02
- 0.18.0 — 2018-03-28
- 0.17.1 — 2018-03-27
- 0.17.0 — 2018-03-26
- 0.16.0 — 2018-03-22
- 0.15.0 — 2018-03-21
- 0.14.0 — 2018-03-16
- … 19 more at https://npm.io/package/jinang/versions

## README

#	jinang
__Collection of Node.js / ECMAScript Mini Modules__

[![coverage status of github.com/YounGoat/jinang](https://coveralls.io/repos/github/YounGoat/jinang/badge.svg?branch=master)](https://coveralls.io/github/YounGoat/jinang2?branch=master)

[![coverage status of github.com/YounGoat/jinang](https://img.shields.io/coveralls/YounGoat/jinang/master.svg)](https://coveralls.io/github/YounGoat/jinang2?branch=master)
[![build status of github.com/YounGoat/jinang](https://travis-ci.org/YounGoat/jinang.svg?branch=master)](https://travis-ci.org/YounGoat/jinang)
[![total downloads of jinang](https://img.shields.io/npm/dt/jinang.svg)](https://www.npmjs.com/package/jinang)
[![jinang's License](https://img.shields.io/npm/l/jinang.svg)](https://www.npmjs.com/package/jinang)
[![latest version of jinang](https://img.shields.io/npm/v/jinang.svg)](https://www.npmjs.com/package/jinang)

>	Other Languages / 敬请等待 / 敬請等待  
>	If links in this document not avaiable, please access [README on GitHub](https://github.com/YounGoat/jinang/blob/master/README.md) directly.

##  Description

__jinang__ is a collection of Node.js / ECMAScript mini modules.

The name *jinang* is abbreviation of "Jin-Nang", which in Chinese means a magic box. The modules in __jinang__ are independent for each other, and are for different usage.

__jinang__ is an incubator. Successful sub modules may be encouraged to be published as independent NPM packages.

Here is its pedigree.  
![jinang.pedigree](./docs/assets/jinang.pedigree.png)

##  Table of Contents

* [Get Started](#get-started)
* [API](#api)
* [Why *jinang*](#why-jinang)
* [The Incubated](#the-incubated)

##  Links

*	[CHANGE LOG](./CHANGELOG.md)
*	[Homepage](https://github.com/YounGoat/jinang)

##	Get Started

```javascript
// Modules are independent for each other and are suggested to be required independently.
const defineError = require('jinang/defineError');

const MyError = defineError('MyError', Error, function(message) {
    this.code = 'SOMETHING_IS_WRONG';
    this.message = message;
});

// ...
throw new MyError('Helo word!');
```

##	API

All sub-modules in __jinang__ are independent from each other. Use `require('jinang/<subModuleName>')` to require the sub-modules.

For your convenience, avaiable modules included in *jinang* are listed here (alphabetically sorted):

*   [absorb](./docs/absorb.md) :
    Concatenate following array(s) to the firt one.
*   [cloneObject](./docs/cloneObject.md) :
    Copy some / all properties from object and return a new one.
*   [co](./docs/co.md) :
    A wrapper of generator function.
*   [currying](./docs/currying.md) :
    Make function curried.
*   [bufferReplace](./docs/bufferReplace.md):
    Return a new buffer with all matches replaced.
*   [defineError](./docs/defineError.md) :
    Create customised Error class.
*   [Directory](./docs/Directory.md) :
    Make it easier to manage a directory.
*   [forInObject](./docs/forInObject.md) :
    The combination of [For...In](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) and [For...Of](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of).
*   [isGenerator](./docs/isGenerator.md) :
    Judge whether it is a [Generator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator).
*   [isGeneratorFunction](./docs/isGeneratorFunction.md) :
    Judge whether it is a [Generator Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*).
*   [jointString](./docs/jointString.md) :
    Concatenate strings with specified joint.
*   [JsonFile](./docs/JsonFile.md) :
    Wrapper of a JSON file.
*   [modifyUrl](./docs/modifyUrl.md) :
    Modify URLs.
*   [open](./docs/open.md) :
    Open URI with matched application.
*   [ordinal](./docs/ordinal.md) :
    Acquire the ordinal form of a natural number.
*   [ott](./docs/ott.md) :
    Wrap a function to allow it invoked only once, twice or thrice.
*   [readable2buffer](./docs/readable2buffer.md) :
    Read a stream and callback with a buffer.
*   [papply](./docs/papply.md) :
    Partial application of a function.
*   [parseOptions](./docs/parseOptions.md) :
    Intelligently parse an option object.
*   [PoC](./docs/PoC.md) :
    Promise or Callback.
*   [Progress](./docs/Progress.md) :
    Progress simulator.
*   [promiseRejectionAutoHandle](./docs/promiseRejectionAutoHandle.md) :
    Avoid console warning when no cather defined.
*   [promisible](./docs/promisible.md) :
    Something like `util.promisify()` but the common error-first callback mode still available.
*   [safeClone](./docs/safeClone.md) :
    A deep and partial clone method.
*   [sleep](./docs/sleep.md) :
    Make current process to "sleep" for a while.
*   [sogo](./docs/sogo.md) :
    To set something into object, or get something from object.
*   [sort](./docs/sort.md) :
    Sort an array.
*   [split](./docs/split.md) :
    Split string in different ways.
*   [table](./docs/table.md) :
    Create a printable table or print a table directly in console. 
*   [trim](./docs/trim.md) :
    Trim everything.
*   [TxtFile](./docs/TxtFile.md) :
    Wrapper of a .txt file.
*   [unescaping](./docs/unescaping.md) :
    A tiny and flexible template render.
*   [uniq](./docs/uniq.md) :
    Compare sibling items in an array and ignore the replications.
*   [write](./docs/write.md) :
    Write into a file. If file not exists, create it.

##  Why *jinang*

__jinang__ is an incubator for creatives which will make programming with Node.js much easier. 

Only mini modules without any dependencies may be put into __jinang__. Although every module is small enough, they all will be maintained carefully and seriously.

##  The Incubated

*   [piui](https://www.npmjs.com/package/piui)  
    from [table](./docs/table.md)
*   [undertake](https://www.npmjs.com/package/undertake)  
    from [co](./docs/co.md), [isGenerator](./docs/isGenerator.md) and [isGeneratorFunction](./docs/isGeneratorFunction.md)

---
_Source: https://npm.io/package/jinang · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
