Easily work with cron expressions using the cron-converter-u2q
package. Effortlessly convert between Unix and Quartz formats and describe cron schedules in plain language.
🔄 Two-way conversion
Effortlessly convert cron expressions:
- From Unix to Quartz
- From Quartz to Unix
📝 Human-readable Descriptions
Translate cron schedules into plain, understandable text:
- Example:
*/5 * * * *
-> "Every 5 minutes"
Using npm:
npm install cron-converter-u2q
Using yarn:
yarn add cron-converter-u2q
Firstly, import the CronConverterU2Q module:
var cron_converter_u2q = require("cron-converter-u2q");
var c2q = cron_converter_u2q.CronConverterU2Q;
If you're using ES6 Modules
import { CronConverterU2QModule as c2q } from "cron-converter-u2q";
const quartzExpression = c2q.unixToQuartz("5 * * * *");
const unixExpression = c2q.quartzToUnix("* */5 * ? * * *");
You can now generate human-readable descriptions for Unix and Quartz cron expressions.
const description = c2q.describeUnix("5 * * * *");
console.log(description); // Outputs: "Every 5 minutes"
const description = c2q.describeQuartz("0 0 8 * * ?");
console.log(description); // Outputs: "At 8 o'clock"
This project is licensed under the MIT License
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Any feedback, suggestions, or contributions are highly appreciated!