unstale

npm / node-cron

node-cron

What changed in node-cron 4, from its official release notes, upgrade guides and advisories. Also covers @types/node-cron. Sources checked 2026-10-24.

3 breaking6 new APIs and options5 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

node-cron 414 changes

Breaking changes 3

  • Inverted ranges expand with wrap-around instead of being silently swapped.

    4.6.0release notes

  • Validates the cron expression when scheduling a task.

    4.6.0release notes

  • Renames the task option distributedTtl to distributedLease; distributedTtl is removed without an alias.

    4.4.1release notes

New APIs and options 6

  • Adds cron.shutdown(timeout?) for graceful process teardown.

    4.6.0release notes

  • Cron expressions support Quartz-style W, L-n and ? modifiers for the day-of-month field.

    4.6.0release notes

  • Emits task:failed when a background daemon exits unexpectedly.

    4.6.0release notes

  • Adds an unref option for heartbeat timers.

    4.6.0release notes

  • Adds a ScheduledTask introspection getter that returns the date and result of the last successful execution, the date and error of the last failed execution, or null before the first run.

    4.5.0release notes

  • Adds extended day-of-week tokens for the nth weekday of the month and the last weekday of the month.

    4.5.0release notes

Fixes and other changes 5

  • Fixes CommonJS type resolution.

    4.6.0release notes

  • Correlates execute() by id, isolates event hooks, and excludes manual runs from maxExecutions counting.

    4.6.0release notes

  • Unrefs the IPC channel so background tasks let the process exit.

    4.6.0release notes

  • Fixes promise bugs that could hang scheduling or crash the process.

    4.6.0release notes

  • Lifecycle calls on a destroyed task become safe no-ops.

    4.6.0release notes