3.0.0 • Published 5 years ago

promise-each-concurrency v3.0.0

Weekly downloads
169
License
-
Repository
github
Last release
5 years ago

Promise each concurrency Build Status

Process an iterable of promises with concurrency

Table of Contents

Install

npm i promise-each-concurrency

# Or with Yarn
yarn add promise-each-concurrency

Usage

import promiseEach from `promise-each-concurrency`;

promiseEach(
  [1, 2, 3],
  function(x) {
    return new Promise(function(resolve) {
      setTimeout(resolve.bind(undefined, x), 1000);
    })
  },
  {
    concurrency: 1
  }
);

Will produce:

1
2
3

With a 1 second pause between each line.

API

promiseEach(
  Iterable<any> input,
  function(any item) iterator,
  options
) -> Promise

Options

NameDefaultDescription
concurrencyMath.infinityhow many items to process at once, default is no limit

Contributing

See the contribute file!

PRs accepted.

License

MIT © Michael Leaney

3.0.0

5 years ago

2.0.1

6 years ago

2.0.0

6 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago