Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cron-runner
Advanced tools
Custom code execution periodically
You should inherit from given module with help of inherit
var inherit = require('inherit'),
CronRunner = require('cron-runner');
var MyCronRunner = inherit(CronRunner, {
__constructor: function (options) {
this.__base(options);
//TODO implement your custom initialization code here
},
execute: function () {
//TODO implement your custom execution code here
}
});
var mcr = new MyCronRunner({
cron: {
pattern: '0 */1 * * * *'
}
});
mcr.start();
You should call constructor of cron-runner module with options object (required). The fields of this object should be:
cron
- simple string or object with field cron
which contains cron pattern string value.
You can receive more details about cron patterns here.logger
- logger configuration. This is optional configuration field for
logger initialization.Switches state of runner to IDLE state. You can call it after your custom execution code for unlock next execution calls.
Switches state of runner to ACTIVE state. You can call it before your custom execution code for lock next execution calls if current execution has not performed yet.
Returns true
if cron runner is in ACTIVE state. Otherwise returns false
.
Normally you should override this methods in you CronRunner inheritance and write your custom code
Performs start of running cron tasks.
Performs stop of running cron tasks.
Run tests:
npm run mocha
Run tests with istanbul coverage calculation:
npm run istanbul
Run codestyle verification (jshint and jscs)
npm run codestyle
Special thanks to:
Maintainer @tormozz48 Please send your questions and proposals to: tormozz48@gmail.com
FAQs
Custom code execution periodically
The npm package cron-runner receives a total of 0 weekly downloads. As such, cron-runner popularity was classified as not popular.
We found that cron-runner 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.