TypeScript

Task Scheduling with AgendaJS in Node.js

Every non-trivial Node.js app eventually needs to run something on a schedule. Send emails at midnight. Retry failed payments every hour. Clean up expired...

17 Apr 2024

Task Scheduling with AgendaJS in Node.js

Every non-trivial Node.js app eventually needs to run something on a schedule. Send emails at midnight. Retry failed payments every hour. Clean up expired sessions daily.

AgendaJS handles this. It's a job scheduling library backed by MongoDB — your jobs survive server restarts because they're persisted in the database, not in memory.

Text
import { MongoClient } from "mongodb"