promise-run-all
v0.0.2
Published
#### how to use ``` // or import const runAll = require('promise-run-all');
Downloads
2
Maintainers
Readme
Promise Run All
how to use
// or import
const runAll = require('promise-run-all');
runAll([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15], (item, index) => {
return async () => {
return item + '-done';
}
}).then(console.log);
params
array: input array
iteratorFn: deal with the logic of each item, can receive
currentItem
,currentIndex
,groupIndex
,allGroup
options:
- groupSize: split array size
- default: 10
- delay: each group request delay
- default: 1000
- requireSuccess: allSettled is true, all is false
- default: false
- onItemComplete: each group finish callback
- default: noop
- groupSize: split array size