nxtcron - v1.0.1
    Preparing search index...

    Variable scheduleConst

    schedule: (
        expr: CronInput,
        callback: () => void,
        options?: ScheduleOptions,
    ) => ScheduleController = ...

    Schedule recurring executions using a cron expression.

    Type Declaration

      • (
            expr: CronInput,
            callback: () => void,
            options?: ScheduleOptions,
        ): ScheduleController
      • Schedule a callback to run on the given cron schedule.

        Parameters

        • expr: CronInput

          A standard 5-field cron string, parsed cron object or special alias. The special '@reboot' alias fires the callback immediately once.

        • callback: () => void

          Function to invoke on each scheduled occurrence.

        • Optionaloptions: ScheduleOptions

          Optional ScheduleOptions with timezone.

        Returns ScheduleController

        A ScheduleController with stop(), on(), and off() methods.

        const job = scheduler.schedule( '0 * * * *', () => console.log( 'tick' ), { timezone: 'UTC' } );
        job.on( 'tick', () => console.log( 'about to fire' ) );
        job.stop();