Skip to content
PACKAGES

fromCron()

Emit wall-clock cron ticks on a graph source.

import { fromCron } from "@graphrefly/ts/sources";
function fromCron(
expr: string,
opts: FromCronOptions = {},
): Operator<never, Date | number | string>
ParameterTypeDescription
exprstringFive-field cron expression.
optsFromCronOptionsCron polling, timezone, DST, abort, and output-shape options.

A source operator that emits the current time when the schedule matches.

import { graph } from "@graphrefly/ts/graph";
import { fromCron } from "@graphrefly/ts/sources";
const everyMinute = graph().initNode(fromCron("0 * * * *"), []);

packages/ts/src/graph/sources.ts