node-cron
4.6.0 · 5 Jul 2026ISC5.7M / weekRepositoryHomepagenpmAtom feed
4.6.0 is the newest release of 4.x.
In short
2 new6 faster1 fixed2 changed
Release note
Added
lastRun()introspection getter onScheduledTask: returns{ date, result }after a successful execution,{ date, error }after a failed one, ornullbefore the first run.Extended day-of-week tokens:
<weekday>#<nth>(nth weekday of the month, e.g.1#1for the first Monday) and<weekday>L(last weekday of the month, e.g.5Lfor the last Friday).
Performance
Cache
Intl.DateTimeFormatinstances per timezone instead of rebuilding on every call.Parse the cron expression once per
TimeMatcherinstead of re-parsing inMatcherWalker.Compute the GMT offset lazily (only when formatting ISO strings, not during the next-run search).
Replace
crypto.randomByteswithcrypto.randomUUIDfor internal ID generation.Skip
setTimeoutjitter wrapper whenmaxRandomDelayis zero.Bundle dist into flat files instead of preserving the module tree (reduces import time).
Fixed
Flaky
should schedule a tasktest: poll for the first execution instead of asserting an exact count after a fixed sleep.
Changed
Renamed internal functions
interpretetointerpretandappendSeccondExpressiontoappendSecondExpression.Rewritten README and package metadata to surface scheduling capabilities (overlap prevention, distributed coordination, background tasks).