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

0.4.2 • Public • Published

wait - Awaitable Delay

Wait is a promise wrapped setTimeout. That's it. Use it for a nicer delay interface.

import wait from 'wait';
 
async function myAsyncFunction() {
  await wait(300);
 
  // do some stuff here
}

You can also use it as a simple sleep for your cli apps:

echo Hi
npx wait 2000 # Will pause execution for 2 seconds. 
echo Bye

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.4.2
    12,634
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.4.2
    12,634
  • 0.4.1
    22
  • 0.4.0
    0
  • 0.3.0
    0
  • 0.2.0
    0
  • 0.1.0
    294

Package Sidebar

Install

npm i wait

Weekly Downloads

5,313

Version

0.4.2

License

MIT

Unpacked Size

4.67 kB

Total Files

15

Last publish

Collaborators

  • trevorburnham
  • ealush