A promise-based sleep function for Deno.
- Minimal and easy to use.
- Can be used to
await
for a specified amount of time.
For Deno:
$ deno add @117/sleep
import { sleep } from "@117/sleep";
const work = async () => {
console.log("please wait for 2 seconds");
await sleep(2000);
console.log("thanks for waiting");
};
work();
Feel free to contribute and PR to your 💖's content.