1.0.2 • Published 3 years ago

better-wait v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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.