# p-props

> Like `Promise.all()` but for `Map` and `Object`

Latest version **6.1.0** (published 2025-09-21) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.1.0 |
| Published | 2025-09-21 |
| First published | 2016-10-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18 |
| Dependencies | 1 |
| Unpacked size | 10.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 201 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | promise, props, map, object, values, properties, entries, async, await, promises, concurrently, concurrency, parallel, bluebird, settled, allsettled |

## Links

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

## 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

- 6.1.0 (latest) — 2025-09-21
- 6.0.0 — 2023-10-13
- 5.0.0 — 2021-06-18
- 4.0.0 — 2020-04-29
- 3.1.0 — 2019-08-31
- 3.0.1 — 2019-06-07
- 3.0.0 — 2019-04-29
- 2.0.0 — 2019-03-12
- 1.2.0 — 2018-04-20
- 1.1.0 — 2017-11-19
- 1.0.0 — 2016-10-21

## README

# p-props

> Like [`Promise.all()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise/all) but for `Map` and `Object`

Useful when you need to run multiple promises concurrently and keep track of the fulfilled values by name.

## Install

```sh
npm install p-props
```

## Usage

```js
import pProps from 'p-props';
import got from 'got';

const fetch = async url => {
	const {body} = await got(url);
	return body;
};

const sites = {
	ava: fetch('https://avajs.dev'),
	todomvc: fetch('https://todomvc.com'),
	github: fetch('https://github.com'),
	foo: 'bar'
};

console.log(await pProps(sites));
/*
{
	ava: '<!doctype …',
	todomvc: '<!doctype …',
	github: '<!doctype …',
	foo: 'bar'
}
*/
```

## API

### pProps(input, mapper?, options?)

Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are fulfilled, or rejects if any of the promises reject. The fulfilled value is the same as `input`, but with a fulfilled version of each entry value, or the fulfilled value returned from `mapper`, if defined.

#### input

Type: `Map | object`

Resolves entry values that are promises. Other values are passed through.

#### mapper(value, key)

Type: `Function`

Receives the current value and key as parameters. If a value is a `Promise`, `mapper` will receive the value this `Promise` resolves to. Expected to return a `Promise` or value.

#### options

Type: `object`

See the [`p-map` options](https://github.com/sindresorhus/p-map#options).

### pPropsAllSettled(input, mapper?, options?)

Like [`Promise.allSettled()`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled) but for `Map` and `Object`.

```js
import {pPropsAllSettled} from 'p-props';
import got from 'got';

const fetch = async url => {
	const {body} = await got(url);
	return body;
};

const sites = {
	ava: fetch('https://avajs.dev'),
	todomvc: fetch('https://todomvc.com'),
	github: fetch('https://github.com'),
	foo: 'bar'
};

console.log(await pPropsAllSettled(sites));
/*
{
	ava: { status: 'fulfilled', value: '<!doctype …' },
	todomvc: { status: 'fulfilled', value: '<!doctype …' },
	github: { status: 'fulfilled', value: '<!doctype …' },
	foo: { status: 'fulfilled', value: 'bar' }
}
*/
```

Returns a `Promise` that is fulfilled when all promises in `input` and ones returned from `mapper` are settled. The fulfilled value is the same as `input`, but with a settled version of each entry value, or the settled value returned from `mapper`, if defined.

#### input

Type: `Map | object`

Resolves entry values that are promises. Other values are passed through.

#### mapper(value, key)

Type: `Function`

Receives the current value and key as parameters. If a value is a `Promise`, `mapper` will receive the value this `Promise` resolves to. Expected to return a `Promise` or value.

#### options

Type: `object`

See the [`p-map` options](https://github.com/sindresorhus/p-map#options).

## Related

- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
- [More…](https://github.com/sindresorhus/promise-fun)

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