Skip to content

wait - promise based function that provides human readable interface for delaying some actions for some period of time

License

Notifications You must be signed in to change notification settings

mdovhopo/better-wait

Repository files navigation

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.

About

wait - promise based function that provides human readable interface for delaying some actions for some period of time

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published