cron
Cron-style job scheduler for Node.js. Uses standard cron syntax to schedule recurring tasks (with second-level precision as optional 6th field). Supports timezone-aware scheduling via the luxon timezone library, job start/stop control, and fire-once-immediately option. Alternative to node-schedule for pure cron syntax scheduling without complex calendar-based expressions.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Local computation only. No network, no credentials. MIT licensed. Callback code security is agent responsibility — cron library itself has no attack surface.
⚡ Reliability
Best When
You need simple cron-style recurring task scheduling within a single Node.js process using familiar cron syntax with timezone support.
Avoid When
You need distributed scheduling, job persistence across restarts, or complex workflow dependencies — use a proper job queue (BullMQ) or workflow orchestrator.
Use Cases
- • Schedule periodic agent maintenance tasks (cache clearing, data refresh, health checks) using standard cron expressions
- • Run database cleanup or aggregation jobs on a cron schedule within Node.js services
- • Implement scheduled report generation or data export pipelines triggered by time-based cron patterns
- • Create simple recurring background jobs in Express.js or Fastify services without a separate job queue
- • Coordinate multiple time-based agent tasks using named CronJob instances that can be stopped and restarted
Not For
- • Distributed job scheduling across multiple Node.js instances — use Bull/BullMQ with Redis for distributed cron jobs
- • Complex workflow orchestration — use temporal-api, n8n-api, or kestra-api for multi-step agent workflows with dependencies
- • Millisecond-precision timing — cron minimum granularity is 1 second
Interface
Authentication
Local library — no authentication required. MIT licensed.
Pricing
MIT licensed. Zero cost.
Agent Metadata
Known Gotchas
- ⚠ Cron expression has 5 or 6 fields — 6-field version adds seconds as the FIRST field: '*/5 * * * * *' means every 5 seconds; 5-field standard cron '* * * * *' = every minute
- ⚠ Jobs are not persistent — process restart loses all scheduled jobs; for persistence use a database-backed scheduler like Agenda or BullMQ
- ⚠ Timezone support requires passing timeZone option: new CronJob('0 9 * * *', fn, null, true, 'America/New_York') — without timeZone, uses process system timezone
- ⚠ onTick callback errors don't stop the job — implement try/catch in callback or the job silently skips failed executions without alerting
- ⚠ Running multiple instances (for HA) of the same service will run jobs N times — distributed environments need external coordination (Redis, DB) to prevent duplicate execution
- ⚠ CronJob starts immediately when start:true is passed as 4th argument — alternatively, call .start() manually after construction
Alternatives
Full Evaluation Report
Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for cron.
AI-powered analysis · PDF + markdown · Delivered within 30 minutes
Package Brief
Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.
Delivered within 10 minutes
Score Monitoring
Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.
Continuous monitoring
Scores are editorial opinions as of 2026-03-07.