Reference
chloejs/timer
When a job runs, written the way it is said.
Cron lines, on their own. This folder imports nothing else in chloe, so it
can be used without the rest: import { every, due, parse } from "chloejs/timer".
Croninterface
export interface Cron {
minute: number[];
hour: number[];
dayOfMonth: number[];
month: number[];
dayOfWeek: number[];
}A cron line as the five sets of numbers it means.
describefunction
export function describe(cron: string, timezone = "UTC"): string | undefinedA cron line in words, when it is one this file could have written.
duefunction
export function due(cron: Cron, at: Date, timezone = "UTC"): booleanWhether a cron line is due at that moment, in that timezone.
everyfunction
export function every(count: number): { readonly minutes: string; readonly hours: string }every(15).minutes and every(4).hours, as a cron line. A count that does
not divide the hour or the day evenly is refused with the reason.
parsefunction
export function parse(line: string): CronA cron line as numbers, or a throw saying what it could not read.