🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

promise-run-all

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-run-all

#### how to use ``` // or import const runAll = require('promise-run-all');

latest
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

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

Keywords

promise

FAQs

Package last updated on 19 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts