Skip to content

Meteor package for specifing cron like recurring jobs easily.

License

Notifications You must be signed in to change notification settings

ashburnham/meteor-easycron

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

meteor-easycron

Meteor package for specifing cron like recurring jobs easily.

The usage is very simple

var recurrence = new Cron(function, schedule);

where schedule is an object that for each of minute, hour, and day either specifies a specific value, or none at all which implies "every". So for instance, the empty object {} means every minute of every hour of every day. On the other hand {day: 12} means every minute of every hour of every 12th of the month.

Examples

var everyMinute = new Cron(function() {
    console.log("another minute has passed!");
}, {});

var everyHour = new Cron(function() {
    console.log("it is 24 minutes past the hour");
}, {
    minute: 24
});

var everyMinuteBetween8and9 = new Cron(function() {
    console.log("a minute has passed and it is between 8am and 9am");
}, {
    hour: 8
});

var onceEveryMonth = new Cron(function() {
    console.log("it is high-noon on the 13th of the month, see you next month");
}, {
    minute: 0,
    hour: 12,
    day: 13
});

About

Meteor package for specifing cron like recurring jobs easily.

Resources

License

Stars

Watchers

Forks

Packages

No packages published