Node Schedule is a flexible cron-like and not-cron-like job scheduler for Node. js. It allows you to schedule jobs (arbitrary functions) for execution at specific dates, with optional recurrence rules. It only uses a single timer at any given time (rather than reevaluating upcoming jobs every second/ minute).
First, node-cron has the same merits and demerits as Node. js, being a runtime of JavaScript, which happens to be a non-blocking single-threaded language that uses the event loop.
After installation using the command npm i node-cron , it must be required into the project like any other Node package: const nodeCron = require("node-cron"); To schedule a job, you need to invoke the nodeCron. schedule method with two arguments.
Agenda uses a MongoDB database to persist scheduled tasks(and the parameters needed for the task) so that even if the server goes down, the tasks will still run at the specified time or intervals. Using Agenda: npm install agenda.
node-cron does just what I described
node-schedule A cron-like and not-cron-like job scheduler for Node.
agenda is a Lightweight job scheduling for node. This will help you.
later.js is a pretty good JavaScript "scheduler" library. Can run on Node.js or in a web browser.
I am using kue: https://github.com/learnboost/kue . It is pretty nice.
The official features and my comments:
Edit:
You can use timexe
It's simple to use, light weight, has no dependencies, has an improved syntax over cron, with a resolution in milliseconds and works in the browser.
Install:
npm install timexe
Use:
var timexe = require('timexe');
var res = timexe("* * * 15 30", function(){ console.log("It's now 3:30 pm"); });
(I'm the author)
node-crontab allows you to edit system cron jobs from node.js. Using this library will allow you to run programs even after your main process termintates. Disclaimer: I'm the developer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With