npm / cron-parser
cron-parser
What changed in cron-parser 5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-25.
14 breaking1 security1 deprecations1 new APIs and options2 performance3 behavior and defaults29 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initcron-parser 551 changes
Breaking changes 14
Day-of-week L syntax is limited to 0L-7L, while day-of-month L syntax must be bare.
Expressions with L inside a range or step, or combined with #, are rejected.
Crontab entries containing = are no longer treated as variables.
Month names are resolved only in the month field, and weekday names only in the day of week field.
Ranges with more than two parts are rejected.
A timestamp of 0 is treated as the Unix epoch rather than as a missing date.
Values for days the month does not have are dropped.
A standalone L in the day-of-week field is now rejected during construction.
Unsatisfiable expressions now throw instead of returning a bogus date because the iteration loop limit is enforced.
Crontab file parsing is now handled by a standalone CronFileParser class rather than CronParser.
Now returns a readonly CronFieldsCollection instance instead of a regular array; use CronFieldsCollection.from to modify the underlying data structure.
The minimum supported Node.js version is now >= 18.
The minimum supported TypeScript version is now >= 5.
The utc option flag was removed; pass in the UTC timezone instead.
Security 1
Bounds expression length and hashed step expansion at parse time.
Deprecations 1
The npm-published 5.6.2 package is deprecated because it shipped the 5.6.1 source tree; use 5.7.0 instead.
New APIs and options 1
Evaluates whether a given date matches the cron pattern.
Performance 2
CronExpression iteration is faster.
Performance improves by around 20–30% on average, depending on pattern complexity.
Behavior and default changes 3
Crontab entries and predefined expressions now use own keys.
String dates now accept the RFC 850 and asctime HTTP date formats.
Day fields that cover their whole range are kept out of the wildcard form.
Fixes and other changes 29
Only whitelisted characters are allowed around an H token.
Rejects a wildcard when it is part of a larger value.
Rejects a day of month that is unavailable in every listed month.
A day is no longer skipped when a DST change removes its midnight hour.
Only quotes around a crontab variable value are removed.
Reset restores the initial date.
Crontab entries that start with a nickname are parsed.
When day-of-month is unrestricted, parsing skips months with no scheduled occurrences.
Preserves crontab fields separated by whitespace when parsing expressions.
Rejects duplicate zero values during field validation.
Bounds field value expansion at parse time.
Short expressions are padded from the leading field slot.
DST transitions wider than one hour are now compensated for.
A hashed step wider than its range no longer empties the field.
Stringifying stepped fields now keeps explicit range bounds.
The current date is rounded to whole seconds so occurrences on the end date are returned.
A day-of-week step no longer adds Sunday when it never reaches 7.
The CronField constructor now copies the values array rather than reusing it.
A matching day of month is no longer dropped when the day of week uses an nth (#) occurrence.
Fixes CronDate throwing on .bind in bundled and CDN builds.
Does not reject an out-of-range day of month when the day of week is restricted.
Handles DST gaps correctly and prevents iteration from stopping prematurely.
Fixes handling of the ES6 iterator done flag, affecting iteration behavior.
Stops the hour-step loop early on spring-forward DST days to prevent skipping a day.
Fixes parsing of repeat ranges in CronExpressionParser.
CronExpression.reset() now preserves the timezone.
Fixed handling when the range is explicitly set and no wildcard is used.
Fixed cases where range and repeat field expressions produced invalid intervals.
Improved repeat serialization for stringification.