Skip to main content
Module

x/oak/util.ts>createPromiseWithResolvers

A middleware framework for handling HTTP with Deno, Node, Bun and Cloudflare Workers 🐿️ 🦕
Extremely Popular
Go to Latest
function createPromiseWithResolvers
import { createPromiseWithResolvers } from "https://deno.land/x/oak@v15.0.0/util.ts";

Offloads to the native Promise.withResolvers when available.

Currently Node.js does not support it, while Deno does.

Returns

{ promise: Promise<T>; resolve: (value: T | PromiseLike<T>) => void; reject: (reason?: any) => void; }