sleep Installation $ npm install @chengaoyuan/sleep Usage import sleep from "@chengaoyuan/sleep"; async function func() { console.log(Date.now()); await sleep(1000); // sleep 1s console.log(Date.now()); } func(); Testing $ npm test