1 # p-limit [![Build Status](https://travis-ci.org/sindresorhus/p-limit.svg?branch=master)](https://travis-ci.org/sindresorhus/p-limit)
3 > Run multiple promise-returning & async functions with limited concurrency
16 const pLimit = require('p-limit');
18 const limit = pLimit(1);
21 limit(() => fetchSomething('foo')),
22 limit(() => fetchSomething('bar')),
23 limit(() => doSomething())
27 // Only one promise is run at once
28 const result = await Promise.all(input);
36 ### pLimit(concurrency)
38 Returns a `limit` function.
49 Returns the promise returned by calling `fn`.
55 Promise-returning/async function.
60 - [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
61 - [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
62 - [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
63 - [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
64 - [More…](https://github.com/sindresorhus/promise-fun)
69 MIT © [Sindre Sorhus](https://sindresorhus.com)