# p-all

> Run promise-returning & async functions concurrently with optional limited concurrency

Latest version **5.0.1** (published 2025-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install p-all
pnpm add p-all
yarn add p-all
bun add p-all
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.1 |
| Published | 2025-09-18 |
| First published | 2016-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=16 |
| Dependencies | 1 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 346 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | promise, all, function, func, fn, limited, limit, control, rate, collection, iterable, iterator, fulfilled, async, await, promises, concurrent, concurrently, concurrency, parallel, bluebird |

## Links

- npm: https://www.npmjs.com/package/p-all
- Repository: https://github.com/sindresorhus/p-all
- Homepage: https://github.com/sindresorhus/p-all#readme
- Issues: https://github.com/sindresorhus/p-all/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/p-all

## Dependencies (1)

- [p-map](https://npm.io/package/p-map.md) ^6.0.0

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 5.0.1 (latest) — 2025-09-18
- 5.0.0 — 2023-04-22
- 4.0.0 — 2021-05-31
- 3.0.0 — 2020-03-22
- 2.1.0 — 2019-04-06
- 2.0.0 — 2019-03-02
- 1.0.0 — 2016-10-21

## README

# p-all

> Run promise-returning & async functions concurrently with optional limited concurrency

Similar to `Promise.all()`, but accepts functions instead of promises directly so you can limit the concurrency.

If you're doing the same work in each function, use [`p-map`](https://github.com/sindresorhus/p-map) instead.

See [`p-series`](https://github.com/sindresorhus/p-series) for a serial counterpart.

## Install

```sh
npm install p-all
```

## Usage

```js
import pAll from 'p-all';
import got from 'got';

const actions = [
	() => got('https://sindresorhus.com'),
	() => got('https://avajs.dev'),
	() => checkSomething(),
	() => doSomethingElse()
];

console.log(await pAll(actions, {concurrency: 2}));
```

## API

### pAll(tasks, options?)

Returns a `Promise` that is fulfilled when all promises returned from calling the functions in `tasks` are fulfilled, or rejects if any of the promises reject. The fulfilled value is an `Array` of the fulfilled values in `tasks` order.

#### tasks

Type: `Iterable<Function>`

Iterable with promise-returning/async functions.

#### options

Type: `object`

##### concurrency

Type: `number` *(Integer)*\
Default: `Infinity`\
Minimum: `1`

Number of concurrently pending promises.

##### stopOnError

Type: `boolean`\
Default: `true`

When set to `false`, instead of stopping when a promise rejects, it will wait for all the promises to settle and then reject with an [`AggregateError`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/AggregateError) containing all the errors from the rejected promises.

##### signal

Type: [`AbortSignal`](https://developer.mozilla.org/docs/Web/API/AbortSignal)

You can abort the promises using [`AbortController`](https://developer.mozilla.org/docs/Web/API/AbortController).

## Related

- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
- [p-series](https://github.com/sindresorhus/p-series) - Run promise-returning & async functions in series
- [p-props](https://github.com/sindresorhus/p-props) - Like `Promise.all()` but for `Map` and `Object`
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
- [p-limit](https://github.com/sindresorhus/p-limit) - Run multiple promise-returning & async functions with limited concurrency
- [More…](https://github.com/sindresorhus/promise-fun)

---
_Source: https://npm.io/package/p-all · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
