1.1.1 • Published 3 years ago

promise-concurrency v1.1.1

Weekly downloads
17
License
MIT
Repository
github
Last release
3 years ago

promise-concurrency

Build Status

run promises in parallel with a concurrency limit.

Installation

npm install promise-concurrency

Example

The most common use case:

var promiseFactories = [5, 4, 3, 2, 1].map(function (item) {
    return function () {
        return new Promise(function (resolve, reject) {
            setTimeout(function () {
                resolve(item);
            }, item * 100);
        });
    };
});
promiseConcurrency(promiseFactories, 2).then(function (value) {
    console.log(value); // => [5, 4, 3, 2, 1]
});
1.1.1

3 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago