Node.js Callback to Promise setTimeout promisified


Example

function wait(ms) {
    return new Promise(function (resolve, reject) {
        setTimeout(resolve, ms)
    })
}