>setTimeout is not an async function, so you can't use it with ES7 async-await. But you could implement your sleep function using ES6 Javascript Promise: