
Security News
Opengrep Adds Apex Support and New Rule Controls in Latest Updates
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
countdown-ti
Advanced tools
基于时间戳的倒计时插件
通过 npm 安装
$ yarn add countdown-ti
# 或者
$ npm i -S countdown-ti
import countdown from 'countdown-ti';
// const countdown = require('countdown-ti');
countdown(3, (sec) => {
console.log('tick', sec);
}, () => {
console.log('complete');
});
或者直接在 html 中引入。
<script src="dist/countdown.js"></script>
<script>
countdown(3, function (sec) {
console.log('tick', sec);
}, function () {
console.log('complete');
});
</script>
// 2参数 倒计时秒数,结束回调
countdown(10, () => {
console.log('done');
});
// 3参数 倒计时秒数,倒计时回调,结束回调
countdown(10, (sec) => {
console.log(sec); // 显示剩余秒数
}, () => {
console.log('done');
});
// 2参数 10位时间戳,结束回调
countdown(1513826388, () => {
console.log('done');
});
// 2参数 13位时间戳,结束回调
countdown(1513826388000, () => {
console.log('done');
});
// 2参数 日期格式字符串,结束回调
countdown('2017-11-11 11:11:11', () => {
// 要兼容id6/safari,请将时间改成 '2017/11/11 11:11:11'
console.log('done');
});
Type: number
string
倒计时时间:
Type: callback
倒计时回调,参数可以得到当前剩余秒数。
Type: callback
倒计时完成回调,没有参数。
FAQs
The npm package countdown-ti receives a total of 0 weekly downloads. As such, countdown-ti popularity was classified as not popular.
We found that countdown-ti demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.