Skip to content

laqudee/promise-futurable

Repository files navigation

Promise Futurable

Implement an Owner Promise.

Building Promises from scratch

refer to:JavaScript Promises by Building a Custom Implementation

refer to: Custom Promise

Usage

# install
npm install @laqudee/promise-futurable

# usage
import Futurable from '@laqudee/promise-futurable'

Development

# install
pnpm install

# dev -- use tsx compiler .ts file in command line
pnpm dev

# build -- use rollup build
pnpm build

# test -- use vitest
pnpm test

# format -- use prettier
pnpm format

# dev:cjs -- example
# "type": "module",  // if add type: module; dev:cjs can't work
pnpm dev:cjs

#dev esm -- example
pnpm dev:esm
# link fro global
pnpm link --global

# when use custom-promise
pnpm link --global @laqudee/promise-futurable