
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Create timers that can run often, but not block by long executions. Great for worker-roles and such that have many jobs to do periodically.
$ npm install timer-jobs
var TimerJob = require('timer-jobs');
var someTimer = new TimerJob({interval: 5000}, function(done) {
console.log('hey');
done();
});
someTimer.start();
Options:
blocking
: boolean
- This determines if the timer should allow a new callback to be started before one finishes. Defaults to true
.interval
: Interval time, in milliseconds. Attempts to start the callback at this value.autoStart
: boolean
- No need to call timer.start()
after creating the timer. Defaults to false
.immediate
: boolean
- If true
, calls the callback right when the job starts, doesn't wait for interval
milliseconds. Defaults to false
ignoreErrors
: boolean
- Ff true
, automatically restarts the job if an error was sent from the callback.Callback:
The function
to call every interval
milliseconds.
Starts up ye olde job!
Stop the job! If a callback is in the middle of execution, it does not cancel it. Only when it calls back.
function() {}
Emitted when the timer has successfully started.
function() {}
Emitted when the timer has successfully stopped.
function() {}
Emitted on every interval, BEFORE the callback function is called
function([err], [args]) {}
Emitted every time the callback calls its done
function. If there is an error - the job HALTS until you start it back up, or if options.ignoreErrors
is true.
err
: Error passed from the callbackargs
: Any additional arguments passed from the callbackFAQs
Create timers that can run often, but not block by long executions
We found that timer-jobs 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.