$ account kelektiv
This repository is the `cron` npm package — a long-standing Node.js library for scheduling callbacks or system commands using cron syntax, with an optional leading seconds field. In production it parses a cron expression into per-field boolean match maps, then drives a setTimeout loop that computes the next matching instant (via Luxon for timezone conversion) and fires registered callbacks. It also supports one-shot Date/Luxon DateTime triggers, execution through child_process spawn, UTC offsets in minutes, presets (@hourly, @daily, etc.), and a threshold option that recovers from missed deadlines caused by event-loop stalls (execute immediately if within threshold, otherwise skip with a warning). Architecture is a compact, clean TypeScript library: src/constants.ts holds field constraints, aliases, and presets; src/time.ts implements CronTime (expression parsing plus next-date search with DST forward/backward ambiguity handling and an 8-year max-match cap for leap-day-only schedules); src/job.ts implements CronJob (timer lifecycle, MAXDELAY chunking for setTimeouts beyond ~24.8 days, waitForCompletion semantics, and threshold-based missed-deadline policy); src/types/cron.types.ts exposes rich parameter/context typing including a recursive IntRange utility that constrains cron field values at compile time. Public entry points exported from src/index.ts are CronJob, CronTime, sendAt, timeout, and validateCronExpression. Maintenance is exemplary: semantic-release automation with trusted npm publishing and provenance, a CI matrix across Node 18/20/22/23/24/25 on Linux/Windows/macOS, enforced coverage thresholds (85% statements/lines/functions, 75% branches), Renovate-driven dependency updates, CodeQL and OpenSSF scorecard checks, and a fast-check property-based fuzz suite (100k randomized runs per tier) complementing the hand-written Jest unit tests. The codebase is current with its ecosystem — TypeScript 5.9, Jest 30, Node 24/25 support — with only a minor lag in ESLint (v8 vs current v9) and typescript-eslint (v7 vs v8), which does not meaningfully impair the project.