Introduction to cron-expression-validator node-module

Image for post
Image for post

what is a cron expression?

Image for post
Image for post

Quartz

What is cron-expression-validator?

Installation

npm install cron-expression-validator

What cron-expression-validator do?

Usage

var cronValidator = require('cron-expression-validator');
var isValid = cronValidator.isValidCronExpression("* * * * * ? *"); // isValid -> true
if(cronValidator.isValidCronExpression("* * * * * ? *")) { 
// returns true
// Your code
}
if(cronValidator.isValidCronExpression("* * * * * * *")) {
// returns false
}
var validObj = cronValidator.isValidCronExpression(
"* * * * 25/2 ? *", {error: true});
var validObj = cronValidator.isValidCronExpression(
"* * * ? * * 123/555", {error: true});
var isValid = cronValidator.isValidCronExpression(
"0 0 12 1/2 * ? *", {error: false});

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store