Product
Introducing Java Support in Socket
We're excited to announce that Socket now supports the Java programming language.
@types/node-cron
Advanced tools
TypeScript definitions for node-cron
npm install --save @types/node-cron
This package contains type definitions for node-cron (https://github.com/node-cron/node-cron).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-cron.
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;
}
These definitions were written by morsic, burtek, Richard Honor, Ata Berk YILMAZ, Alex Seidmann, and Pedro Américo.
FAQs
TypeScript definitions for node-cron
The npm package @types/node-cron receives a total of 522,575 weekly downloads. As such, @types/node-cron popularity was classified as popular.
We found that @types/node-cron demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Product
We're excited to announce that Socket now supports the Java programming language.
Security News
Socket detected a malicious Python package impersonating a popular browser cookie library to steal passwords, screenshots, webcam images, and Discord tokens.
Security News
Deno 2.0 is now available with enhanced package management, full Node.js and npm compatibility, improved performance, and support for major JavaScript frameworks.