node-task-scheduler
v2.2.0
Published
A Task scheduler for node.js, with cron-syntax, specific execution intervals and due dates
Downloads
3
Readme
node-task-scheduler
A Task scheduler for node.js, with cron-syntax, specific execution intervals and due dates.
Instalation
npm install --save node-task-scheduler
Example usage
var nts=require('node-task-scheduler');
var scheduler = nts.init({
// add some parameters! Check wiki for details
});
global.scheduler = scheduler; //available to entire application
//starting previous tasks
ts.start(function(taskNames){
console.log("Previous tasks loaded:");
taskNames.forEach(function(taskName){
console.log(taskName);
});
});
...
//adding task, to be executed each minute, until endDate
scheduler.addTask('hello', {hello: 'world'}, function(args, callback){
console.log("Hello from hello! ", "ARGS: "+args.hello);
callback();
}, "0 * * * * *", endDate);
...
//removing the task
scheduler.removeTask('hello', function(){
console.log("Task 'hello' removed.");
});
Wiki
Yes, we have a wiki! Click here for details.