Wiki
Clone wikischeduler-cron / IntervalJob
IntervalJob
It is designed for execution in specified interval
Options
-
interval
- the interval in which function will be executedtype: Number | function
- returns: Number - the next interval
-
func
- the function that will be executedtype: function
- returns: undefined
-
options
-
startDate
- the date when function execution will be startedtype: Date
-
Methods
-
stop
- stops function executionreturns: undefined
How to use
var IntervalJob = require('scheduler-cron').IntervalJob; var hourInterval = 1000 * 60 * 60; new IntervalJob(hourInterval, function() { // Send a congratulatory message to the users' chat }, { startDate: new Date(2017, 0, 1) });
Updated