• Version 3.0.11
  • Published
  • 6.23 kB
  • No dependencies
  • MIT license


npm i @types/node-cron
yarn add @types/node-cron
pnpm add @types/node-cron


TypeScript definitions for node-cron



function getTasks

getTasks: () => Map<string, ScheduledTask>;
  • Get the list of tasks created using the schedule function

function schedule

schedule: (
cronExpression: string,
func: string | ((now: Date | 'manual' | 'init') => void),
options?: ScheduleOptions
) => ScheduledTask;
  • Creates a new task to execute the given function when the cron expression ticks.

    Parameter cronExpression

    Parameter func

    Parameter options

function validate

validate: (cronExpression: string) => boolean;
  • To validate whether the expression is a cron expression or not

    Parameter cronExpression


interface ScheduledTask

interface ScheduledTask extends EventEmitter {}

    property now

    now: (now?: Date) => void;

      property start

      start: () => void;

        property stop

        stop: () => void;

          interface ScheduleOptions

          interface ScheduleOptions {}

            property name

            name?: string;
            • The schedule name

            property recoverMissedExecutions

            recoverMissedExecutions?: boolean;
            • Specifies whether to recover missed executions instead of skipping them.

              Defaults to false

            property runOnInit

            runOnInit?: boolean;
            • Execute task immediately after creation

            property scheduled

            scheduled?: boolean | undefined;
            • A boolean to set if the created task is scheduled.

              Defaults to true

            property timezone

            timezone?: string;
            • The timezone that is used for job scheduling

            Package Files (1)

            Dependencies (0)

            No dependencies.

            Dev Dependencies (0)

            No dev dependencies.

            Peer Dependencies (0)

            No peer dependencies.


            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/node-cron.

            • Markdown
            • HTML
              <a href="https://www.jsdocs.io/package/@types/node-cron"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>