chloejsnpm i chloejs

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".

Crondescribedueeveryparse

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.

chloe/timer/cron.ts:6

describefunction

export function describe(cron: string, timezone = "UTC"): string | undefined

A cron line in words, when it is one this file could have written.

chloe/timer/every.ts:116

duefunction

export function due(cron: Cron, at: Date, timezone = "UTC"): boolean

Whether a cron line is due at that moment, in that timezone.

chloe/timer/cron.ts:57

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.

chloe/timer/every.ts:32

parsefunction

export function parse(line: string): Cron

A cron line as numbers, or a throw saying what it could not read.

chloe/timer/cron.ts:23