Croner

A zero-dependency cron job scheduler and cron-expression evaluator for JavaScript and TypeScript

Library
npm
v10.0.1
2,610 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
61 /100 Good
Development Activity 52
Maintenance 44
Community 48
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
80 /100 Excellent
Architecture 80
Code Quality 82
Innovation 72
Learning Curve 85

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

TypeScript
90%
MIT

OpenClaw

AI Agents · AI Assistants

392,894

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.

View details
88
Repo Health
88
Technical
66
Dependency
Built with
TypeScript 90%
Updated today
Vue
41%
AGPL 3.0

Operational

Analytics · Automation · Monitoring

474

Open-source event tracker with real-time push notifications and action buttons for tech founders.

View details
54
Repo Health
68
Technical
68
Dependency
Built with
Vue 41%
JavaScript 39%
MDX 13%
Updated 3 weeks ago
TypeScript
96%
MIT

Payload CMS

Blogging · CMS · Developer Tools

45,458

The open-source, Next.js-native headless CMS that lives inside your /app folder and gives you a full TypeScript backend instantly.

View details
92
Repo Health
88
Technical
65
Dependency
Built with
TypeScript 96%
Updated today
TypeScript
94%
MIT

qm

AI Agents · AI Assistants · Automation

15,518

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.

View details
81
Repo Health
88
Technical
73
Dependency
Built with
TypeScript 94%
Updated today
TypeScript
96%
Apache 2.0

rakazo

AI Agents · AI Assistants

5,488

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.

View details
82
Repo Health
91
Technical
70
Dependency
Built with
TypeScript 96%
Updated yesterday
TypeScript
91%
MIT

SerpBear

Analytics · Marketing

2,128

Self-hosted keyword rank tracker with Google Search Console integration, multi-provider SERP scraping, and a built-in REST API.

View details
48
Repo Health
67
Technical
68
Dependency
Built with
TypeScript 91%
Updated 5 months ago
TypeScript
92%
Other

Suna

AI Agents

20,306

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.

View details
90
Repo Health
79
Technical
65
Dependency
Built with
TypeScript 92%
Updated today
TypeScript
98%
Apache 2.0

Tianji

Analytics · Monitoring

3,119

Replace Google Analytics, UptimeKuma, and Prometheus with one self-hosted platform that tracks websites, monitors uptime, and reports server health.

View details
86
Repo Health
76
Technical
64
Dependency
Built with
TypeScript 98%
Updated yesterday
TypeScript
95%
MIT

understudy

AI Agents · Automation

463

Open-source local AI agent that operates your entire computer — GUI, browser, shell, and messaging — from a single instruction, using your own models.

View details
32
Repo Health
79
Technical
74
Dependency
Built with
TypeScript 95%
Updated 4 months ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers