Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

promise-all-props

1.0.1 • Public • Published

promise-all-props

Travis Build Status David devDependencies Status

Inspired by bluebird's Promise.props.

Like Promise.all but for object properties instead of iterated values. Returns a promise that is fulfilled when all the properties of the object are fulfilled. The promise's fulfillment value is an object with fulfilled values at respective keys to the original object. If any promise in the object rejects, the returned promise is rejected.

Install

npm install promise-all-props --save

Usage example

const promiseAllProps = require('promise-all-props');
 
promiseAllProps({
    foo: Promise.resolve('foo'),
    bar: Promise.resolve('bar')
}).then(function(result) {
    console.log(result.foo, result.bar);
});

Install

npm i promise-all-props

DownloadsWeekly Downloads

98

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar