Node.js JavaScript library to convert unix or linux CRON syntax to Quartz Scheduler
npm install cron-to-quartz







Node.js JavaScript library to convert unix or linux CRON syntax to Quartz Scheduler
- Node.js
Install the module as a dependency in your project so you can easily require it and use it as a library
``javascript`
yarn add cron-to-quartz
To use the cron-to-quartz as a library to work with and explore, you should clone the repository and install required modules.
- Note: the node.js grunt task runner is required as a build tool for the library
`bash`
git clone https://github.com/lirantal/cron-to-quartz.git
cd cron-to-quartz
yarn install
You can then run the test suite:
`bash`
yarn run test
In your NodeJS projects, simply require this library:
`javascript`
var C2Q = require("../index.js");
Then you can just query the C2Q object with any cron notation as seen in the following examples:
`javascript`
var quartz = C2Q.getQuartz("@hourly");
var quartz = C2Q.getQuartz("0 0,12 1 /2 ");
var quartz = C2Q.getQuartz("00 11,13 *");
The Quartz Scheduler isn't fully compatible with the CRON notation, so while CRON allows logical OR expressions, Quartz doesn't do that. For this reason, if you provide such CRON syntax, then the C2Q object will yield an array of 2 values:
`javascript``
var quartz = C2Q.getQuartz("0 4 15-21 * 1");
CronMaker is an online web-based utility to help build and test expressions that are compatible with the Quartz open source schedule.
cron.guru is an online web-based utility to translate a valid Linux CRON expression to an actual human readable schedule
Quartz Scheduler Developer Guide
Liran Tal