Croner

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

Library
npm
v10.0.1
2,582stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
59/100Fair
Development Activity44
Maintenance44
Community48
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
80/100Excellent
Architecture80
Code Quality82
Innovation72
Learning Curve85

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 16 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

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
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
TypeScript
91%
MIT

bunqueue

Developer Tools · Devops

535

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

View details
74
Repo Health
83
Technical
76
Dependency
Built with
TypeScript91%
Updated 2 weeks ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

50,753

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

View details
88
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
TypeScript
93%
Apache 2.0

flue

AI Agents · Developer Tools

7,953

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

View details
67
Repo Health
82
Technical
75
Dependency
Built with
TypeScript93%
Updated 1 weeks ago
TypeScript
48%
AGPL 3.0

Grafana

Monitoring · Analytics

76,300

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
65
Dependency
Built with
TypeScript48%
Go46%
Updated today
TypeScript
94%
MIT

Kaneo

Product Management · Productivity · Project Management

8,371

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

View details
86
Repo Health
81
Technical
70
Dependency
Built with
TypeScript94%
Updated today
Svelte
49%

Kener

Monitoring · Devops

5,114

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

View details
85
Repo Health
76
Technical
68
Dependency
Built with
Svelte49%
TypeScript47%
Updated 2 weeks ago
TypeScript
99%
Apache 2.0

Mastra Code

AI Code Assistants

27,294

"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
88
Repo Health
73
Technical
66
Dependency
Built with
TypeScript99%
Updated today
TypeScript
88%
MIT

Mistle

AI Agents · Developer Tools

89

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

View details
71
Repo Health
76
Technical
71
Dependency
Built with
TypeScript88%
Rust11%
Updated 1 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

Search