timeout-then
setTimeout
as a promise.
const timeout = require('timeout-then');
timeout(100).then(function () {
console.log('blah');
});
// clear timeout
let timer = timeout(100);
timer.then(function () {
console.log('blah');
});
timer.clear();