Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jinang

YounGoat5.4k0.26.1

Collection of Node.js / ECMAScript Gists

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

readme

jinang

Collection of Node.js / ECMAScript Mini Modules

coverage status of github.com/YounGoat/jinang

coverage status of github.com/YounGoat/jinang build status of github.com/YounGoat/jinang total downloads of jinang jinang's License latest version of jinang

Other Languages / 敬请等待 / 敬請等待
If links in this document not avaiable, please access README on GitHub 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

Table of Contents

Get Started

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

changelog

jinang Change Log

Notable changes to this project will be documented in this file. This project adheres to Semantic Versioning 2.0.0.

[0.26.1] - Jan 5th, 2020

[0.26.0] - May 19th, 2019

[0.25.0] - Mar 9th, 2019

[0.24.0] - Feb 28th, 2019

[0.23.0] - Jan 28th, 2019

[0.22.0] - May 13th, 2018

Developed on Apr 24th, 2018.

[0.21.0] - Apr 23rd, 2018

[0.20.0] - Apr 9th, 2018

[0.19.0] - Apr 2nd, 2018

[0.18.0] - Mar 28th, 2018

[0.17.1] - Mar 27th, 2018

  • jinang/table udpated to support setting about column alignment.

[0.17.0] - Mar 26th, 2018

[0.16.0] - Mar 22nd, 2018

[0.15.0] - Mar 21st, 2018

[0.14.0] - Mar 16th, 2018

[0.13.0] - Mar 15th, 2018

[0.12.0] - Mar 9th, 2018

[0.11.0] - Mar 8th, 2018

[0.10.0] - Mar 6th, 2018

[0.9.0] - Feb 22th, 2018

[0.8.0] - Feb 7th, 2018

[0.7.0] - Jan 28, 2018

[0.6.0] - Jan 20, 2018

[0.5.2] - Jan 15, 2018

[0.5.0] - Jan 8, 2018

[0.4.0] - Jan 4,2018

[0.3.0] - Dec 27, 2017

[0.2.1] - Dec 25, 2017

[0.2.0] - Dec 22, 2017

[0.1.0] - Nov 30, 2017

[0.0.5] - Nov 29, 2017

[0.0.3] - Nov 21, 2017

[0.0.1] - 2017-11-1

Released.


This CHANGELOG.md follows Keep a CHANGELOG.