countdowntime

0.0.3 • Public • Published

安装

npm i countdowntime

使用

var countdowntime = require("countdowntime");
//假设结束时间为endTime
var endTime = new Date().getTime() + 30000;
//倒计时结束时回调
var endCb = function(){
console.log("countDown is END!")
}
//倒计时进行中每秒钟执行一次回调,接收当前所剩具体时间
var timeCb = function(time){
console.log(time)
}
//开始执行倒计时
countdowntime.getCountDownTime(now,timeCb,endCb);

说明

var countdowntime = require("countdowntime");
console.log(countdowntime)
打印信息为:
{ formatNumber: [Function: formatNumber],
getRemainTime: [Function: getRemainTime],
getCountDownTime: [Function: getCountDownTime] }

formatNumber--单位数字补零
getRemainTime--获取剩余时间明细
getCountDownTime--开始倒计时

Readme

Keywords

Package Sidebar

Install

npm i countdowntime

Weekly Downloads

2

Version

0.0.3

License

ISC

Unpacked Size

2.73 kB

Total Files

3

Last publish

Collaborators

  • dongkf