Croner
A zero-dependency cron job scheduler and cron-expression evaluator for JavaScript and TypeScript
Repository Health
Technical Analysis
Croner lets JavaScript and TypeScript code trigger functions on a cron schedule, or simply evaluate cron expressions to compute upcoming/previous run times, without pulling in any runtime dependencies. It extends standard cron syntax with seconds and year fields plus L (last), W (nearest weekday), # (nth weekday occurrence), and + (AND logic) modifiers, and it runs unmodified across Node.js, Deno, Bun, and the browser (as a standalone script, UMD bundle, or ES module).
Beyond simple scheduling, Croner builds in the operational guardrails that hand-rolled setInterval-based schedulers usually lack: overrun protection so a slow-running job doesn’t overlap itself, structured error handling for both sync and async job functions, per-job pause/resume/stop control, and explicit time-zone targeting for schedules that must run relative to a specific locale rather than server local time. Because everything runs in-memory with no database or config files, it fits equally well as a lightweight in-process scheduler for a small service or as the timing engine embedded inside a larger job-processing system.
What You Get
new Cron(pattern, fn)to schedule a function against a cron expression with extended syntax (seconds, years,L/W/#/+).nextRun()/.nextRuns(n)/ previous-run helpers to evaluate a cron expression without actually scheduling anything- Built-in overrun protection so a long-running job invocation doesn’t overlap its next scheduled trigger
- Structured error handling for both synchronous and asynchronous job functions
- Per-job
.pause()/.resume()/.stop()control after a job has been scheduled - Explicit time-zone targeting so schedules run against a specific zone rather than server local time
Common Use Cases
- Running periodic maintenance jobs (cleanup, cache refresh, report generation) inside a Node.js/Bun backend service
- Scheduling in-browser reminders or periodic UI refreshes without a server-side cron daemon
- Computing ‘next N occurrences’ of a cron expression for a scheduling UI or admin dashboard
- Embedding cron-based timing as the scheduling engine inside a larger task/job-processing system
Under The Hood
Architecture - The library is authored Deno-first: deno.json defines the canonical ./src/croner.ts export, and a build/build.ts script (using esbuild plus esbuild-plugin-d.ts) compiles the Deno source down to the published npm package, so a single TypeScript codebase targets JSR, npm, and browser bundles from one source of truth. Core logic is split across src/croner.ts (the Cron class and scheduling loop), src/pattern.ts (cron-expression parsing including the extended L/W/#/+ modifiers), src/date.ts (date math and next/previous run computation), and src/helpers/timezone.ts (time-zone-aware evaluation). Tech Stack - Pure TypeScript with zero runtime dependencies; builds and tests run through Deno’s own toolchain (deno test, deno lint, deno fmt) rather than a Node-centric bundler, with esbuild used only for the npm/browser distribution step. Code Quality - The test/ directory contains a large, expression-focused Deno test suite (pattern.test.ts, range.test.ts, question-mark.test.ts, previous-runs.test.ts, several ocps-*.test.ts conformance suites), reflecting the project’s emphasis on correctly matching cron-expression edge cases across many real-world patterns. API Design - The primary API is a single Cron(pattern, fn, options) constructor plus a handful of instance methods (nextRun, nextRuns, pause, resume, stop), which keeps the surface area small; supporting both ‘trigger a function’ and ‘just evaluate an expression’ from the same constructor lets the same mental model cover both scheduling and pure cron-math use cases.
Used by 19 apps in this directory
OpenClaw
AI Agents · AI Assistants
An open-source AI assistant that runs on your own hardware and meets you in Discord, Slack, WhatsApp, iMessage, Telegram, and 20+ other channels, with native apps for every major platform.
Operational
Analytics · Automation · Monitoring
Open-source event tracker with real-time push notifications and action buttons for tech founders.
Payload CMS
Blogging · CMS · Developer Tools
The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.
qm
AI Agents · AI Assistants · Automation
An open-source, multiplayer agent harness that gives every employee and every room in a company its own scoped memory, sandbox, and AI agent — in Slack and on the web.
rakazo
AI Agents · AI Assistants
An open-source platform for persistent AI teammates that own their own conversations, memory, routines, and computers — self-hosted, model-agnostic, and available on web, desktop, and mobile.
SerpBear
Analytics · Marketing
Self-hosted keyword rank tracker with Google Search Console integration, multi-provider SERP scraping, and a built-in REST API.
Suna
AI Agents
Turn your company into a git repo — one config, one command center, a workforce of AI agents that runs the real work around the clock.
Tianji
Analytics · Monitoring
Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.
understudy
AI Agents · Automation
Open-source local AI agent that operates your entire computer — GUI, browser, shell, and messaging — from a single instruction, using your own models.