Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@codefeathers/promise.object

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@codefeathers/promise.object

Deep resolve promises in objects.

  • 0.11.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

📤 Promise.object

Promise.object is Promise.all for objects, and it traverses deeply! It's also fully typed.

Installation

npm install --save @codefeathers/promise.object

Usage

import promiseObject from "@codefeathers/promise.object";

const resolved = await Promise.object({
	foo: Promise.resolve(5),
	bar: {
		baz: Promise.resolve([ 1, 2, 3 ])
	}
});

console.log(resolved);
//-> { foo: 5, bar: { baz: [ 1, 2, 3 ] } }

We need to go deeper!

import promiseObject from "@codefeathers/promise.object";

const resolved = await Promise.object(
	Promise.resolve({
		foo: Promise.resolve({
			bar: Promise.resolve(5)
		})
	})
);

console.log(resolved);
//-> { foo: { bar: 5 } }

Deno

import promiseObject from "https://deno.land/x/promise_object@v0.10.0";

Credits

The original idea and challenge was from @TRGWII.

Keywords

FAQs

Package last updated on 09 Mar 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc