promise-run-all
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

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

  1. array: input array

  2. iteratorFn: deal with the logic of each item, can receive currentItem, currentIndex, groupIndex, allGroup

  3. 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

Package Sidebar

Install

npm i promise-run-all

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

65.5 kB

Total Files

13

Last publish

Collaborators

  • 0xfourdim