# What changed in node-cron

> 14 changes in node-cron 4 from its official release notes, upgrade guides and advisories: 3 breaking, 6 new APIs and options. Each one cited. Sources checked 2026-10-24. HTML: https://unstale.sh/npm/node-cron/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## node-cron 4

### Breaking changes

- Inverted ranges expand with wrap-around instead of being silently swapped. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Validates the cron expression when scheduling a task. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Renames the task option distributedTtl to distributedLease; distributedTtl is removed without an alias. (4.4.1) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.4.1)

### New APIs and options

- Adds cron.shutdown(timeout?) for graceful process teardown. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Cron expressions support Quartz-style W, L-n and ? modifiers for the day-of-month field. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Emits task:failed when a background daemon exits unexpectedly. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Adds an unref option for heartbeat timers. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- 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.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.5.0)
- Adds extended day-of-week tokens for the nth weekday of the month and the last weekday of the month. (4.5.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.5.0)

### Fixes and other changes

- Fixes CommonJS type resolution. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Correlates execute() by id, isolates event hooks, and excludes manual runs from maxExecutions counting. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Unrefs the IPC channel so background tasks let the process exit. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Fixes promise bugs that could hang scheduling or crash the process. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
- Lifecycle calls on a destroyed task become safe no-ops. (4.6.0) — [release notes](https://github.com/node-cron/node-cron/releases/tag/v4.6.0)
