giovanebribeiro / node-task-scheduler

A task scheduler for node.js with cron-like syntax and specific intervals.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DEPRECIATED!!

This project was an incredible lab for me and I learned many things. However, the node.js changed a lot and I don't have time at the moment to upgrade it. So, I decided to archive this repo. To everyone that (still!) uses this lib, I recommend the amazing project agenda

Thank you for all support. See ya!

node-task-scheduler Build Status npm version Coverage Status

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.

License

MIT

About

A task scheduler for node.js with cron-like syntax and specific intervals.

License:MIT License


Languages

Language:JavaScript 100.0%