batched-promises
v1.0.4
Published
Execute promises parallelly with a concurrency limit
Downloads
6
Readme
batched-promises
Executes promises parallelly with a concurrency limit.
Installation
$ npm i batched-promises
Usage
const batchPromises = require('batched-promises');
const fns = [
() => new Promise(resolve => resolve()),
() => new Promise(resolve => resolve()),
() => new Promise(resolve => resolve()),
() => new Promise(resolve => resolve()),
() => new Promise(resolve => resolve()),
];
batchPromises(fns, {concurrencyLimit: 3})
.then(() => console.log('done'));