Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/p-props
Like `Promise.all()` but for `Map` and `Object`
https://github.com/sindresorhus/p-props
Last synced: about 1 month ago
JSON representation
Like `Promise.all()` but for `Map` and `Object`
- Host: GitHub
- URL: https://github.com/sindresorhus/p-props
- Owner: sindresorhus
- License: mit
- Created: 2016-10-21T04:02:15.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2023-10-13T19:55:36.000Z (about 1 year ago)
- Last Synced: 2024-04-13T21:00:27.274Z (7 months ago)
- Language: TypeScript
- Size: 25.4 KB
- Stars: 186
- Watchers: 7
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-list - p-props
- promise-fun - p-props
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: '