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

1.1.0 • Public • Published

Promisify Wait

Promisify wait is a simple function to await timeout

Installation

To use promisify-wait in your project, using npm:

npm install promisify-wait

or using yarn:

yarn add promisify-wait

Usage

import wait, { DURATION_UNIT } from "promisify-wait";

# wait 1000 milliseconds
await wait(1000) #Default in millisecond

# wait 10 seconds
await wait(10, DURATION_UNIT.SECOND)

# wait 1 minute 
await wait(1, DURATION_UNIT.MINUTE)

# wait 1 hour
await wait(1, DURATION_UNIT.HOUR)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

Package Sidebar

Install

npm i promisify-wait

Weekly Downloads

230

Version

1.1.0

License

ISC

Unpacked Size

3.9 kB

Total Files

5

Last publish

Collaborators

  • sanyann