Node.js Cron — Schedule Jobs with node-cron
*/5 * * * *Every 5 minutes
Next 10 Executions
Times shown in UTC
- Mon, May 18, 202608:10
- Mon, May 18, 202608:15
- Mon, May 18, 202608:20
- Mon, May 18, 202608:25
- Mon, May 18, 202608:30
- Mon, May 18, 202608:35
- Mon, May 18, 202608:40
- Mon, May 18, 202608:45
- Mon, May 18, 202608:50
- Mon, May 18, 202608:55
Field Breakdown
*/5Minute
Every 5 minutes
*Hour
Every hour
*Day of Month
Every day
*Month
Every month
*Day of Week
Every day of week
About This Schedule
The node-cron npm package lets you schedule tasks in Node.js using cron syntax:
import cron from 'node-cron';
cron.schedule('*/5 * * * *', () => {
console.log('Running every 5 minutes');
});Key features of node-cron:
- 5 or 6 fields: Supports optional seconds field (6 fields)
- Timezone support: Pass
timezoneoption - Validation:
cron.validate('*/5 * * * *')returns true/false - Named days/months: Supports JAN-DEC, SUN-SAT
Alternative packages:
- cron (npm): More feature-rich, supports
CronJobclass - agenda: MongoDB-backed job scheduler
- bull: Redis-backed queue with cron support
- bree: Worker threads-based scheduler