cron-explain-cli
v1.0.0
Published
Cron expression explainer and builder CLI
Downloads
140
Maintainers
Readme
cron-explain-cli
A zero-bloat CLI for explaining, validating, building, and scheduling cron expressions.
Install
npm install -g @asdsadw12312dwd2112xz/cron-explain-cliCommands
parse <expression>
Explain a cron expression in plain English.
cron-explain parse "0 9-17 * * 1-5"
# Every hour, from hour 9:00 AM through 5:00 PM, from Monday through Friday.next <expression> [--count N]
Show the next N execution times (default: 5).
cron-explain next "*/15 * * * *" --count 3validate <expression>
Check whether a cron expression is syntactically valid.
cron-explain validate "0 0 32 * *"build [flags]
Build a cron expression from individual field flags.
cron-explain build --minute 0 --hour 9 --weekday 1-5
# 0 9 * * 1-5
cron-explain build --second 0 --minute "*/5" --hour "*" --six
# 0 */5 * * * *Flags: --second, --minute, --hour, --day, --month, --weekday, --six (6-field)
examples
Display 20 common cron patterns with explanations.
cron-explain examplesbetween <expression> <start> <end>
Count how many times a cron fires between two dates.
cron-explain between "0 9 * * 1-5" 2024-01-01T00:00:00 2024-12-31T23:59:59Cron Format
Supports both 5-field and 6-field (with seconds) expressions:
| Field | 5-field | 6-field | Range | |----------|---------|---------|-------| | Second | — | 1st | 0–59 | | Minute | 1st | 2nd | 0–59 | | Hour | 2nd | 3rd | 0–23 | | Day/Month| 3rd | 4th | 1–31 | | Month | 4th | 5th | 1–12 | | Weekday | 5th | 6th | 0–7 |
Special characters: * (any), , (list), - (range), / (step), ? (any)
Named months: jan–dec. Named weekdays: sun–sat.
License
MIT
