Promise based async sleep function.
npm i @jellybeanci/sleep
// ES6 Syntax
import {sleep, delay} from "@jellybeanci/sleep";
// Commonjs Syntax
const {sleep, delay} = require("@jellybeanci/sleep");
console.log("See you after 5 sec");
await sleep(5000);
console.log("5 sec passed");
console.log("See you after 5 sec");
await delay(5);
console.log("5 sec passed");
type sleep = (millisecond: number) => Promise<unknown>;
type delay = (second: number) => Promise<unknow>;