better-wait
v1.0.2
Published
Convenient delay function with human friendly interface
Downloads
33
Readme
better-wait
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.