Simple timer count down for future time
$ npm install future-count-down--save
const countdown=require('future-count-down')
countdown({
endDate:new Date('2020-12-1')//a future time
interval:1000// millseconds,
run:function({days,hours,minutes,seconds}){
console.log(`${days} days ${hours}:${minutes}:${seconds}`)
},
finish(){
//do something when finished
}
})
MIT © insonghua2.