Skip to content

ealush/wait

This branch is 1 commit ahead of, 2 commits behind master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

3ba431f Β· Aug 12, 2021

History

3 Commits
Nov 26, 2020
Nov 26, 2020
Oct 30, 2020
Oct 30, 2020
Oct 30, 2020
Aug 12, 2021
Nov 26, 2020
Oct 30, 2020
Oct 30, 2020

Repository files navigation

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