npm / cron
cron
What changed in cron 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
15 breaking1 new APIs and options1 tooling2 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initcron 45 changes
Breaking changes 2
job.running was renamed to job.isActive; update code that reads or writes the old property.
Node v16 is no longer supported, so developers must use a supported Node.js version.
Tooling 1
Node versions were updated to include 24 and 25.
Fixes and other changes 2
Suppresses the setTimeout warning when negative values are used.
Errors in async onTick functions are now caught.
cron 313 changes
Breaking changes 12
The method was removed; use new CronJob(...args) or CronJob.from(argsObject) instead.
The method was removed; use new CronTime() instead.
CronJob can be constructed with arguments using new CronJob(...args), replacing cron.job().
CronJob.from(argsObject) is the alternative for object-based job creation.
The constructor no longer accepts an object as its first and only parameter; use CronJob.from(argsObject) instead.
Callbacks are now called in the order they were registered.
CronTime can be instantiated with new CronTime(), replacing cron.time().
Calling nextDates without an argument now returns an empty array.
Providing both timeZone and utcOffset now throws an error.
Cron behavior was aligned with UNIX standards.
utcOffset no longer accepts a string.
Values between -60 and 60 are no longer interpreted as hours.
New APIs and options 1
Useful types are now exposed for developers.
cron 21 changes
Breaking changes 1
The project moves from moment.js to luxon, a breaking change for developers using the affected date-time functionality.