
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
Persistent cron jobs for Node.js with MongoDB storage.
Survives server restarts and supports flexible scheduling.
npm install evercron mongodb
const { MongoClient } = require('mongodb');
const EverCron = require('evercron');
(async () => {
// 1. Connect to MongoDB
const client = await MongoClient.connect('mongodb://localhost:27017');
const jobs = client.db('myapp').collection('cronJobs');
// 2. Create scheduler
const scheduler = new EverCron(jobs);
// 3. Schedule jobs
await scheduler.schedule(
'nightly-backup',
'daily at 02:00',
backupDatabase,
{ timezone: 'Asia/Kolkata' }
);
})();
| Type | Example | Description |
|---|---|---|
| Interval | 'every 30 minutes' | Recurring duration |
| Daily | 'daily at 15:30' | Specific time daily |
| Cron | '0 * * * *' | Standard cron syntax |
schedule(name, schedule, taskFn, options)Schedule a new job.
await scheduler.schedule(
'weekly-report',
'0 9 * * 1', // Every Monday at 9 AM
generateReport,
{
maxRetries: 3,
timezone: 'America/Chicago'
}
);
cancel(name)Cancel a scheduled job.
await scheduler.cancel('obsolete-job');
restore()Restore scheduled jobs after a server restart.
await scheduler.restore();
await scheduler.schedule(
'test-job',
'every 1 minute',
testTask,
{ timezone: 'UTC' }
);
const jobs = await jobsCollection.find().toArray();
```---
## 🧪 How to Test Jobs in Development?
### Manually Trigger a Job
```js
await scheduler.schedule(
'test-job',
'every 1 minute',
testTask,
{ timezone: 'UTC' }
);
const jobs = await jobsCollection.find().toArray();
FAQs
MongoDB-persistent job scheduler
We found that evercron demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.