Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

promise-all-props

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

promise-all-props

Like `Promise.all` but for object properties.

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
413
61.33%
Maintainers
1
Weekly downloads
 
Created
Source

promise-all-props

npm bundlephobia

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

Node.js:
npm install promise-all-props

Deno:
https://deno.land/x/promise_all_props

Usage example

import { promiseAllProps } from 'promise-all-props';

promiseAllProps({
  foo: Promise.resolve('foo'),
  bar: Promise.resolve('bar')
}).then((result) => {
  console.log(result.foo, result.bar);
});

Keywords

promise

FAQs

Package last updated on 28 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts