1.2.0 • Published 9 years ago
cronzitto v1.2.0
Cronzitto
Cronzitto allows you to schedule tasks to run
Install
First of all, make sure you have Node.js installed.
$ [sudo] npm install cronzitto
Usage
var Cron = require('cronzitto');
Run a task every time interval
var watchMail = Cron.watch( function() {
//Mail.getAll();
}, '10 minutes');
The watch method accepts two parameters: the callback and timer.
Cancel event
To cancel a cronzitto event, use the stop method
watchMail.cancel();
Reset Time
watchMail.resetTimer('30 minutes');
Sleep
Waiting time to continue execution
watchMail.sleep('5 minutes');
Only once
Perform a task only once after the end of the timer.
Cron.once( function() {
//run after a second
}, '1 minute');
Notify
You can receive notifications when the task finishes or is stopped.
Requirements! To use Growl notifications, you need to install node-growl.
Non-Notify
To disable the notifications engine, set the Cronzitto:
Cron.config.notify = false;
Non-Beep
To disable the BEEP sound:
Cron.config.beep = false;
License
Cronzitto is available under the MIT license.