better-wait
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

better-wait

Deploy Coverage Status

Convenient delay function with human friendly interface

Installation:

npm i better-wait
yarn add better-wait

Usage

import { wait } from 'better-wait';

await wait('3s'); // use human readable values for delay
await wait(1000); // use milliseconds if you feel more like a machine
await wait('1 hour', { reject: true }); // promise will reject
await wait('1 year', { returnValue: 'your custom return value' }); // you can also return anything you want

Bootstrapped with: create-ts-lib-gh

This project is Mit Licensed.

Readme

Keywords

Package Sidebar

Install

npm i better-wait

Weekly Downloads

20

Version

1.0.2

License

MIT

Unpacked Size

7.04 kB

Total Files

6

Last publish

Collaborators

  • tricky-max