Socket
Socket
Sign inDemoInstall

@types/node-cron

Package Overview
Dependencies
0
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @types/node-cron

TypeScript definitions for node-cron


Version published
Weekly downloads
346K
decreased by-0.16%
Maintainers
1
Install size
6.09 kB
Created
Weekly downloads
 

Readme

Source

Installation

npm install --save @types/node-cron

Summary

This package contains type definitions for node-cron (https://github.com/node-cron/node-cron).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-cron.

index.d.ts

import { EventEmitter } from "events";

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

/**
 * To validate whether the expression is a cron expression or not
 * @param cronExpression
 */
export function validate(cronExpression: string): boolean;

/**
 * Get the list of tasks created using the `schedule` function
 */
export function getTasks(): Map<string, ScheduledTask>;

export interface ScheduledTask extends EventEmitter {
    now: (now?: Date) => void;
    start: () => void;
    stop: () => void;
}

export interface ScheduleOptions {
    /**
     * A boolean to set if the created task is scheduled.
     *
     * Defaults to `true`
     */
    scheduled?: boolean | undefined;
    /**
     * The timezone that is used for job scheduling
     */
    timezone?: string;
    /**
     * Specifies whether to recover missed executions instead of skipping them.
     *
     * Defaults to `false`
     */
    recoverMissedExecutions?: boolean;
    /**
     * The schedule name
     */
    name?: string;
    /**
     * Execute task immediately after creation
     */
    runOnInit?: boolean;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 20:08:00 GMT
  • Dependencies: none

Credits

These definitions were written by morsic, burtek, Richard Honor, Ata Berk YILMAZ, Alex Seidmann, and Pedro Américo.

FAQs

Last updated on 07 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc