@nkp/smart-promise
TypeScript icon, indicating that this package has built-in type declarations

0.0.6 • Public • Published

@nkp/smart-promise

npm version deploy status known vulnerabilities

Zero dependency SmartPromise utility. SmartPromise is is a Promise that can be resolved from outside it's executor.

import { SmartPromise } from '@nkp/smart-promise';

const promise = new SmartPromsie<string>();
promise.then((value) => console.log('resolved with:', value));
promise.resolve('success :)');
// resolved with: success :)

Table of contents

Installation

npm

npm install @nkp/smart-promise

yarn

yarn add @nkp/smart-promise

pnpm

pnpm add @nkp/range

Exports

@nkp/smart-promise targets CommonJS and ES modules. To utilise ES modules consider using a bundler like webpack or rollup.

Updating dependencies

To update dependencies run one of

# if npm
# update package.json
npx npm-check-updates -u
# install
npm install

# if yarn
# update package.json
yarn create npm-check-updates -u
# install
yarn

# if pnpm
# update package.json
pnpx npm-check-updates -u
# install
pnpm install

Publishing

To a release a new version:

  1. Update the version number in package.json
  2. Push the new version to the master branch on GitHub
  3. Create a new release on GitHub for the latest version

This will trigger a GitHub action that tests and publishes the npm package.

Readme

Keywords

Package Sidebar

Install

npm i @nkp/smart-promise

Weekly Downloads

2

Version

0.0.6

License

MIT

Unpacked Size

23.8 kB

Total Files

7

Last publish

Collaborators

  • nickkelly