cron
- Version 4.3.4
- Published
- 157 kB
- 2 dependencies
- MIT license
Install
npm i cronyarn add cronpnpm add cronOverview
Cron jobs for your node
Index
Variables
Functions
Classes
Interfaces
Type Aliases
Variables
variable validateCronExpression
const validateCronExpression: (cronExpression: string) => { valid: boolean; error?: CronError;};Functions
Classes
class CronJob
class CronJob<OC extends CronOnCompleteCommand | null = null, C = null> {}constructor
constructor( cronTime: any, onTick: CronCommand<C, WithOnComplete<OC>>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: string, context?: {}, runOnInit?: boolean, utcOffset?: null, unrefTimeout?: boolean, waitForCompletion?: boolean, errorHandler?: (error: unknown) => void, name?: string, threshold?: number);constructor
constructor( cronTime: any, onTick: CronCommand<C, WithOnComplete<OC>>, onComplete?: CronOnCompleteCommand, start?: boolean, timeZone?: null, context?: {}, runOnInit?: boolean, utcOffset?: number, unrefTimeout?: boolean, waitForCompletion?: boolean, errorHandler?: (error: unknown) => void, name?: string, threshold?: number);property context
context: {};property cronTime
cronTime: CronTime;property errorHandler
errorHandler?: (error: unknown) => void;property isActive
readonly isActive: boolean;property isCallbackRunning
readonly isCallbackRunning: boolean;property lastExecution
lastExecution: Date;property name
name?: string;property onComplete
onComplete?: CronOnCompleteCallback;property runOnce
runOnce: boolean;property threshold
threshold: number;property unrefTimeout
unrefTimeout: boolean;property waitForCompletion
waitForCompletion: boolean;method addCallback
addCallback: (callback: CronCallback<C, WithOnComplete<OC>>) => void;method fireOnTick
fireOnTick: () => Promise<void>;method from
static from: <OC extends CronOnCompleteCommand = null, C = null>( params: CronJobParams<OC, C>) => CronJob<OC, C>;method lastDate
lastDate: () => Date | null;method nextDate
nextDate: () => any;method nextDates
nextDates: (i?: number) => import('luxon').DateTime<boolean>[];method setTime
setTime: (time: CronTime) => void;method start
start: () => void;method stop
stop: () => Promise<void> | undefined;class CronTime
class CronTime {}constructor
constructor(source: any, timeZone?: string, utcOffset?: null);constructor
constructor(source: any, timeZone?: null, utcOffset?: number);property realDate
realDate: boolean;property source
source: any;property timeZone
timeZone?: string;property utcOffset
utcOffset?: number;method getNextDateFrom
getNextDateFrom: ( start: Date | CustomDateTime, timeZone?: string | CustomZone) => DateTime;method getTimeout
getTimeout: () => number;method sendAt
sendAt: { (): DateTime; (i: number): DateTime[] };method toJSON
toJSON: () => string[];method toString
toString: () => string;method validateCronExpression
static validateCronExpression: (cronExpression: string) => { valid: boolean; error?: CronError;};Interfaces
Type Aliases
type CronCallback
type CronCallback<C, WithOnCompleteBool extends boolean = false> = ( this: CronContext<C>, onComplete: WithOnCompleteBool extends true ? CronOnCompleteCallback : never) => void | Promise<void>;type CronCommand
type CronCommand<C, WithOnCompleteBool extends boolean = false> = | CronCallback<C, WithOnCompleteBool> | CronSystemCommand;type CronContext
type CronContext<C> = C extends null ? CronJob : NonNullable<C>;type CronJobParams
type CronJobParams< OC extends CronOnCompleteCommand | null = null, C = null> = BaseCronJobParams<OC, C> & ( | { timeZone?: string | null; utcOffset?: never; } | { timeZone?: never; utcOffset?: number | null; } );type CronOnCompleteCallback
type CronOnCompleteCallback = () => void | Promise<void>;type CronOnCompleteCommand
type CronOnCompleteCommand = CronOnCompleteCallback | CronSystemCommand;type TimeUnit
type TimeUnit = (typeof TIME_UNITS_MAP)[keyof typeof TIME_UNITS_MAP];Package Files (4)
Dependencies (2)
Dev Dependencies (29)
- @commitlint/cli
- @eslint/js
- @fast-check/jest
- @insurgent/commitlint-config
- @insurgent/conventional-changelog-preset
- @semantic-release/changelog
- @semantic-release/commit-analyzer
- @semantic-release/git
- @semantic-release/github
- @semantic-release/npm
- @semantic-release/release-notes-generator
- @swc/core
- @swc/jest
- @types/jest
- @types/node
- @types/sinon
- cross-env
- eslint
- eslint-config-prettier
- eslint-plugin-jest
- eslint-plugin-prettier
- husky
- jest
- lint-staged
- prettier
- semantic-release
- sinon
- typescript
- typescript-eslint
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto 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/cron.
- Markdown[](https://www.jsdocs.io/package/cron)
- HTML<a href="https://www.jsdocs.io/package/cron"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4243 ms. - Missing or incorrect documentation? Open an issue for this package.
