Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
cron-expression-validator
Advanced tools
cron-expression-validator is a Node.JS library (support typescript) to validate quartz cron expressions
npm install cron-expression-validator
isValidCronExpression method reqire string (cron expression) as parameter and returns boolean value
var cronValidator = require('cron-expression-validator');
var isValid = cronValidator.isValidCronExpression("* * * * * ? *"); // returns true
if(cronValidator.isValidCronExpression("* * * * * ? *")) { // returns true
// Your code
}
if(cronValidator.isValidCronExpression("* * * * * * *")) {
// returns false
}
Can get error message by passing { error: true }
as second parameter
if(cronValidator.isValidCronExpression("* * * * 25/2 ? *", {error: true}) {
/** returns {
/* isValid: false,
/* errorMessage: [ 'Month values must be between 1 and 12' ]
/* }
**/
}
if(cronValidator.isValidCronExpression("* * * ? * * 123/555", {error: true}) {
/** returns {
/* isValid: false,
/* errorMessage: [ '(Year) - Unsupported value 123 for field. Possible values are 1970-2099 , - * /',
/* '(Year) - Expression 555 is not a valid increment value. Accepted values are 0-129'
/* ]
/* }
**/
}
if(cronValidator.isValidCronExpression("0 0 12 1/2 * ? *", {error: false}) { // returns true
// Your code
}
Seconds: 0-59 * , -
Minutes: 0-59 * , -
Hours: 0-23 * , -
Day of Month: 1-31 * , - ? L LW
Months: (JAN-DEC or 1-12) * , -
Day of Week: (SUN-SAT or 1-7) * , L - ? #
Year: 1970-2099 * , -
MIT
FAQs
Validate cron expressions
We found that cron-expression-validator 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.