Skip to main content
Home

latest
Works with
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score82%
Published2 years ago (0.1.0)

Recursively awaits all promises inside an object

deep-promise

Recursively awaits all promises inside an object.

const result = await recurse([
	{ id: 1, entry: Promise.resolve({ text: 'Hello' }) },
	{ id: 2, entry: Promise.resolve({ text: 'World' }) },
]);

result;
// ^? [
//   { id: 1, entry: { text: 'Hello' } },
//   { id: 2, entry: { text: 'World' } },
// ]

Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@mary/deep-promise

Import symbol

import * as deep_promise from "@mary/deep-promise";
or

Import directly with a jsr specifier

import * as deep_promise from "jsr:@mary/deep-promise";

Add Package

pnpm i jsr:@mary/deep-promise
or (using pnpm 10.8 or older)
pnpm dlx jsr add @mary/deep-promise

Import symbol

import * as deep_promise from "@mary/deep-promise";

Add Package

yarn add jsr:@mary/deep-promise
or (using Yarn 4.8 or older)
yarn dlx jsr add @mary/deep-promise

Import symbol

import * as deep_promise from "@mary/deep-promise";

Add Package

vlt install jsr:@mary/deep-promise

Import symbol

import * as deep_promise from "@mary/deep-promise";

Add Package

npx jsr add @mary/deep-promise

Import symbol

import * as deep_promise from "@mary/deep-promise";

Add Package

bunx jsr add @mary/deep-promise

Import symbol

import * as deep_promise from "@mary/deep-promise";