Croner

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

Library
npm
v10.0.1
2,596 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
95%
Apache 2.0

AionUi

AI Agents · Productivity

33,179

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
85
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 95%
Updated 3 weeks ago
TypeScript
93%
MIT

bunqueue

Developer Tools · Devops

570

High-performance job queue for Bun — SQLite persistence, cron scheduling, DLQ, S3 backups, and a native MCP server, all without Redis.

View details
73
Repo Health
83
Technical
72
Dependency
Built with
TypeScript 93%
Updated 3 weeks ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

52,202

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
70
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
94%
Apache 2.0

flue

AI Agents · Developer Tools

8,383

Build autonomous AI agents and powerful workflows with a programmable TypeScript harness that gives any model sessions, tools, sandboxes, and durable execution.

View details
80
Repo Health
82
Technical
70
Dependency
Built with
TypeScript 94%
Updated 1 weeks ago
TypeScript
48%
AGPL 3.0

Grafana

Analytics · Monitoring

76,962

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript 48%
Go 46%
Updated 4 days ago
TypeScript
90%
MIT

Kaneo

Product Management · Productivity · Project Management

9,250

Lightweight self-hosted project management that gives you kanban boards, GitHub sync, and full team collaboration without the enterprise bloat.

View details
87
Repo Health
81
Technical
70
Dependency
Built with
TypeScript 90%
Updated 5 days ago
TypeScript
50%

Kener

Devops · Monitoring

5,181

Stunning, self-hosted status pages with real-time uptime monitoring, incident management, and multi-channel notifications in a single Docker container.

View details
86
Repo Health
76
Technical
67
Dependency
Built with
TypeScript 50%
Svelte 47%
Updated 2 weeks ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

28,378

"A coding agent that never compacts" — a terminal-based AI coding agent built on the Mastra framework, with Observational Memory instead of context compaction, multi-model support, and OAuth login for Claude Max or ChatGPT Plus.

View details
90
Repo Health
73
Technical
65
Dependency
Built with
TypeScript 99%
Updated 4 days ago
TypeScript
88%
MIT

Mistle

AI Agents · Developer Tools

93

Self-hostable platform for running autonomous coding agents in isolated, credentialless sandboxes with brokered credentials, reusable snapshots, and event-driven triggers.

View details
68
Repo Health
76
Technical
70
Dependency
Built with
TypeScript 88%
Rust 11%
Updated 2 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