@mary/deep-promise@0.1.0
latest
Recursively awaits all promises inside an object
This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
JSR Score
82%
Published
3 months ago (0.1.0)
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' } }, // ]
Add Package
deno add jsr:@mary/deep-promise
Import symbol
import * as mod from "@mary/deep-promise";
---- OR ----
Import directly with a jsr specifier
import * as mod from "jsr:@mary/deep-promise";
Add Package
npx jsr add @mary/deep-promise
Import symbol
import * as mod from "@mary/deep-promise";
Add Package
yarn dlx jsr add @mary/deep-promise
Import symbol
import * as mod from "@mary/deep-promise";
Add Package
pnpm dlx jsr add @mary/deep-promise
Import symbol
import * as mod from "@mary/deep-promise";
Add Package
bunx jsr add @mary/deep-promise
Import symbol
import * as mod from "@mary/deep-promise";