Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Cron for NodeJS.
JavaScript
branch: master

This branch is 216 commits behind ncb000gt:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src
.gitignore
Makefile
README.md
package.json
test.js

README.md

A NodeJS fork of jamespadolsey's cron.js.

Usage:

var cron = require('cron'), sys = require('sys');
new cron.CronJob('* * * * * *', function(){
    sys.puts('You will see this message every second');
});

Available Cron patterns:

Asterisk. E.g. *
Ranges. E.g. 1-3,5
Steps. E.g. */2

Read up on cron patterns here.

Another example:

var cron = require('cron'), sys = require('sys');
new CronJob('00 30 11 * * 2-6', function(){
    // Runs every weekday (Monday through Friday)
    // at 11:30:00 AM. It does not run on Saturday
    // or Sunday.
});

How to check if a cron pattern is valid:

    try {
        new cron.CronTime('invalid cron pattern', function() {
            sys.puts('this should not be printed');
        })
    } catch(ex) {
        sys.puts("cron pattern not valid");
    }

Install:

make install

Uninstall:

make uninstall

License:

This is under a dual license, MIT and GPL. However, the author of cron.js hasn't specified which version of the GPL, once I know I'll update this project and the packaging files.

Something went wrong with that request. Please try again.