cron-schedule is a robust, zero-dependency library designed for parsing cron expressions and scheduling tasks across Node.js, Deno, and browser environments. The current stable version is 6.0.0. The project maintains an active release cadence, frequently publishing patch and minor versions to address bugs and introduce features, with major versions typically aligning with Node.js End-of-Life cycles to ensure compatibility with modern runtime environments. Key differentiators include its complete lack of external dependencies, support for a wide range of JavaScript runtimes, a lightweight footprint, and full tree-shakeability. It provides comprehensive functionalities for parsing cron strings, calculating next or previous scheduled dates, generating date iterators, and directly scheduling function calls based on cron patterns. The library also offers full TypeScript support and is published on JSR, making it a versatile choice for various JavaScript/TypeScript projects.
npm install cron-scheduleVerified import paths — ran on the pinned version, not inferred.
Demonstrates parsing a cron expression to calculate next occurrences and how to set up a basic, albeit short-lived, cron job scheduler.
Upgrade your Node.js environment to version 20, 22, or 24.
Upgrade your Node.js environment to version 16 or higher (20+ for v6).
If experiencing import issues with schedulers, change your import statement from `import { createCronScheduler } from 'cron-schedule/schedulers'` to `import { createCronScheduler } from 'cron-schedule/dist/schedulers'`.Do not install or use `cron-schedule@5.0.0`. Instead, use `cron-schedule@5.0.1` or any subsequent version.
Ensure you are using ECMAScript module imports (`import ... from 'package'`) rather than CommonJS `require()` syntax.
Update to `cron-schedule@5.0.4` or a newer version.
Update to `cron-schedule@5.0.3` or a newer version for correct Sunday range starting, and `cron-schedule@4.0.0` or newer for general Sunday range parsing fixes.
Update to `cron-schedule@5.0.1` or a newer version.
Update to `cron-schedule@5.0.2` or a newer version which includes improved whitespace handling.
No dependency data recorded yet.