tiny-promises
v1.0.8
Published
Extend nodejs Promise with a lot of useful methods. # Installation `$ npm install --save tiny-promises` # Usage - Require it in your main file (entry point). ```javascript // index.js
Downloads
4
Readme
tiny-promises
Extend nodejs Promise with a lot of useful methods.
Installation
$ npm install --save tiny-promises
Usage
- Require it in your main file (entry point).
// index.js
require('tiny-promises');
- Create your *.d.ts in root folder and add reference to
tiny-promises
type.
// app.d.ts
/// <reference types="tiny-promises" />
- Done.
Methods
queue
Promise.queue<T, K>(queue: T[], handler: (item: T) => Promise<K>): Promise<K[]>
pipe
Promise.pipe<T>(...funcs: ((arg) => Promise<T>)[]): (arg) => Promise<T>
pipeArray
Promise.pipeArray<T>(funcs: ((arg) => Promise<T>)[]): (arg) => Promise<T>