New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-countdown

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-countdown

term countdown

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

Countdown

倒计时

Install

npm i node-countdown --save

Example

var countdown = require('node-countdown');

countdown.start(5000, {suffix: '后开始备份'}, function(err){
    err ?
        console.log(err.message):
        console.log('开始备份...');
})

API

countdown.start(time [, options, fn])

options = {
    prefix: '前缀',
    suffix: '后缀',
    // 循环任务
    loop: false,
    // 时间单位格式化数组
    // eg: ['years', 'months', ...]
    format: ['年', '月', '天', '小时', '分', '秒']
}

time 倒计时时间,单位ms
options

  • prefix 描述信息前缀
  • suffix 描述信息后缀
  • loop 是否建立循环任务,默认为false
  • format 时间单位格式化数组

fn 倒计时完成后回调

Preview

loop: false
Preview
loop: true
Preview loop

Keywords

countdown

FAQs

Package last updated on 02 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts