Resolvable Promise

A promise that is resolvable (or rejectable) after it was created.

const promise = new ResolvablePromise()
promise.then(x => console.log('Resolved!', x))
promise.resolve({ foo: 'bar' })

<p align="center"><a href="https://workers.tools"><img src="https://workers.tools/assets/img/logo.svg" width="100" height="100" /></a> <p align="center">This module is part of the Worker Tools collection<br/>⁕

Worker Tools are a collection of TypeScript libraries for writing web servers in Worker Runtimes such as Cloudflare Workers, Deno Deploy and Service Workers in the browser.

If you liked this module, you might also like:

Worker Tools also includes a number of polyfills that help bridge the gap between Worker Runtimes:

Fore more visit workers.tools.

@worker-tools/resolvable-promise - Installation

To install @worker-tools/resolvable-promise via this registry, you'll need to install via the --registry parameter with your package manager.

n

NPM

npm install @worker-tools/resolvable-promise --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Yarn

yarn config set registry https://js.registry.sudovanilla.org
yarn install @worker-tools/resolvable-promise

Learn more about the config option.

PNPM

pnpm install @worker-tools/resolvable-promise --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Bun Logo

Bun

bun install @worker-tools/resolvable-promise --registry https://js.registry.sudovanilla.org

Learn more about the --registry parameter.

Learn more about setting this up in your bunfig.toml configuration.


For Deno, add the following to your .npmrc file in your directory:

registry="https://js.registry.sudovanilla.org"

Then run the deno install command.

@worker-tools/resolvable-promise - Download

Download Tarball (v0.2.0-pre.6)

Integrity sha512-+5RcuruCLB/P3FYYb376RgyImXaq9BBQoOskUbgPyNK3O0AXPakrXUj1EELv+lcnUSdFws/ufdrrWODLJyoTmg==
SHASUM 44f8c07668e3f48632ce9104a8a26244f6f41f5b
Tarball https://js.registry.sudovanilla.org/@worker-tools/resolvable-promise/-/resolvable-promise-0.2.0-pre.6.tgz