promise-maplimit
v1.0.1
Published
maps promises in batches of a specific size
Readme
promise-maplimit
maps promises in batches of a specific size.
Installation
npm i promise-maplimit --saveUsage
The package exports a single function:
mapLimit(array: Any[], batch_size: Integer, mapper: Func<Any, Integer, Any[]> -> Promise<Any>) -> Promise<Any[]>
array: Array of Promises or values or both.batch_size: Positive integer, how many promises run simultaneously.mapper(item, index, array): Function that is called for every entry ofarrayafter it resolves.
The function returns a Promise<Any[]>.
License
MIT
