Promisie
Promisie is an extension of the ES6 native Promise class that provides helpful static methods that are seen in many other Promise libraries
Version
2.0.0-alpha.0
Installation
Because Promisie uses native ES6 Promises, classes and spread operators you must be running Node v6.0.0 or above
$ npm i promisie
Usage
/*Because Promisie is an extension of the Promise class it also acts as a Promise constructor and shares all prototype methods, but adds promisify and promisifyAll static methods*/const Promisie = fs = ;var readFileAsync = Promisie;;var asyncFs = Promisie;asyncFs;/*Promisie also exposes a "try" method which works just like "then" but conveniently wrapped in a try/catch block */ ;/*This would normally halt the execution of your async code because of an unhandled error but the "try" method properly rejects with the error *//*Promisie also has a series static method which runs and array of functions in series passing the result of each function to the next function.Additionally there are pipe and compose static methods which return a function expecting arguments that will be passed to the first function in the series (compose reverses the order of the functions it is passed)*/let array_of_functions = fn fn1 fn2 fn3;Promisie let pipe = Promisie; /*Promisie now has many more helpful methods:- .map- .each- .parallel- .doWhilst- .iterate- .settle- .all- .retrySee documentation for more details and test for usage*/
Notes
- Check out https://github.com/typesettin/promisie for the full promisie Documentation
Testing
$ npm i promisie$ cd ./node_modules/promisie$ npm i$ npm test
For generating documentation
$ grunt doc$ jsdoc2md utility/**/*.js index.js > doc/api.md
Todos
- Add more prototype and static methods
- Filter
- Reduce
- Queue
License
MIT