Skip to main content

@korkje/dfr@0.1.2
Built and signed on GitHub Actions

Creates a promise and extracts resolve/reject functions

This package works with Bun, Cloudflare Workers, Node.js, Deno, Browsers
JSR Score
100%
Published
4 days ago (0.1.2)

dfr JSR

Creates a promise and returns it along with resolve and reject functions.

import dfr from "jsr:@korkje/dfr";

const { promise, resolve, reject } = dfr<string>();

setTimeout(() => resolve("hello"), 1000);

console.log(await promise); // "hello"
Built and signed on
GitHub Actions
View transparency log

Add Package

deno add @korkje/dfr

Import symbol

import * as mod from "@korkje/dfr";

Add Package

npx jsr add @korkje/dfr

Import symbol

import * as mod from "@korkje/dfr";

Add Package

yarn dlx jsr add @korkje/dfr

Import symbol

import * as mod from "@korkje/dfr";

Add Package

pnpm dlx jsr add @korkje/dfr

Import symbol

import * as mod from "@korkje/dfr";

Add Package

bunx jsr add @korkje/dfr

Import symbol

import * as mod from "@korkje/dfr";