JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q40601F
  • License MIT

Run tasks in parallel with a limit.

Package Exports

  • same-time-limit

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (same-time-limit) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

same-time-limit PayPal Version Downloads Get help on Codementor

Run tasks in parallel with a limit.

Installation

$ npm i --save same-time-limit

Example

const sameTimeLimit = require("same-time-limit");

sameTimeLimit([
    cb => setTimeout(_ => cb(null, 42), 1000)
  , cb => setTimeout(_ => cb(null, 43), 1000)
  , cb => setTimeout(_ => cb(null, 44), 1000)
  , cb => setTimeout(_ => cb(null, 45), 1000)
  , cb => setTimeout(_ => cb(null, 46), 1000)
], 2, (err, data) => {
    console.log(err || data);
});

Documentation

sameTimeLimit(tasks, limit, cb)

Runs async tasks in parallel but not more than a given limit in the same time.

Params

  • Array tasks: An array of async functions to call. Their first parameter should be the callback function.
  • Number limit: The max count of functions to run in parallel.
  • Function cb: The callback function.

Return

  • LimitIt The LimitIt instance.

How to contribute

Have an idea? Found a bug? See how to contribute.

Where is this library used?

If you are using this library in one of your projects, add it in this list. ✨

License

MIT © Ionică Bizău