const sleep = ms => new Promise(r => setTimeout(r, ms)); sleep(5000) OR > npm i sleepjs const { sleep } = require('sleepjs') await sleep(500)