Create a promise that resolves after n counts.
$ npm install --save countdown-promise
const Countdown = require('countdown');
const countdown = Countdown(5)
countdown.promise.then(() => console.log('Done!'))
countdown.count().count().count().count()
// Nothing happens yet.
countdown.count() // (note this is the 5th `count`)
// "Done!" is printed on console.
Returns an Object
with a promise
property and a function to count()
.
MIT © Gerardo Munguia