Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 426 Bytes

README.md

File metadata and controls

30 lines (21 loc) · 426 Bytes

wait - Awaitable Delay

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

Instll this package using NPM.

npm i wait

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