Installations
npm install timers-ext
Developer
medikoo
Developer Guide
Module System
Unable to determine the module system for this package.
Min. Node Version
>=0.12
Typescript Support
No
Node Version
20.13.1
NPM Version
10.5.2
Statistics
3 Stars
91 Commits
4 Watching
1 Branches
1 Contributors
Updated on 03 Jun 2024
Languages
JavaScript (100%)
Total Downloads
Cumulative downloads
Total Downloads
908,248,290
Last day
-1.6%
826,583
Compared to previous day
Last week
4.1%
4,477,083
Compared to previous week
Last month
10%
18,532,887
Compared to previous month
Last year
7.6%
204,389,452
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
timers-ext
Timers extensions
Installation
$ npm install timers-ext
To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: Browserify, Webmake or Webpack
API
MAX*TIMEOUT *(timers-ext/max-timeout)_
Maximum possible timeout value in milliseconds. It equals to maximum positive value for 32bit signed integer, so 2³¹ (2147483647), which makes it around 24.9 days
delay(fn[, timeout]) (timers-ext/delay)
Returns function which when invoked will call fn function after specified timeout. If timeout is not provided nextTick propagation is used.
once(fn[, timeout]) (timers-ext/once)
Makes sure to execute fn function only once after a defined interval of time (debounce). If timeout is not provided nextTick propagation is used.
1var nextTick = require("next-tick"); 2var logFoo = function () { console.log("foo"); }; 3var logFooOnce = require("timers-ext/once")(logFoo); 4 5logFooOnce(); 6logFooOnce(); // ignored, logFoo will be logged only once 7logFooOnce(); // ignored 8 9nextTick(function () { 10 logFooOnce(); // Invokes another log (as tick passed) 11 logFooOnce(); // ignored 12 logFooOnce(); // ignored 13});
validTimeout(timeout) (timers-ext/valid-timeout)
Validates timeout value.
For NaN
resolved timeout 0
is returned.
If timeout resolves to a number:
- for timeout < 0
0
is returned - for 0 >= timeout <= MAX_TIMEOUT,
timeout
value is returned - for timeout > MAX_TIMEOUT exception is thrown
Tests
$ npm test
Security contact information
To report a security vulnerability, please use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: ISC License: LICENSE:0
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/integrate.yml:1
- Warn: no topLevel permission defined: .github/workflows/publish.yml:1
- Warn: no topLevel permission defined: .github/workflows/validate.yml:1
- Info: no jobLevel write permissions found
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'main'
Score
3.7
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More