cRonstrue

Turns cron expressions into human-readable descriptions, in 30+ languages.

Library
npm
v3.27.0
1,636 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
84 /100 Excellent
Development Activity 80
Maintenance 88
Community 68
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 80
Code Quality 78
Innovation 55
Learning Curve 90

cronstrue is a zero-dependency JavaScript/TypeScript library that parses a cron expression and outputs a plain-English (or localized) description of the schedule — for example, */5 * * * * becomes “Every 5 minutes”. It supports standard 5-field cron, plus 6- and 7-field variants with seconds and year, Quartz Job Scheduler syntax (#, L, W, ?), and the common @daily/@weekly/@yearly-style shorthand nicknames.

It ships as a UMD module so it works identically in Node/CommonJS, bundlers (ESM/webpack/TypeScript), or a plain browser <script> tag via the unpkg CDN, and includes a small CLI (npx cronstrue "*/5 * * * *") for ad-hoc use from a terminal. Beyond English, cronstrue bundles translations for 30+ languages, selectable per call via the locale option, either all at once (cronstrue/i18n) or as individually tree-shakeable locale modules (cronstrue/locales/[locale]).

What You Get

  • A single toString(expression, options) API that returns a natural-language description of any cron expression
  • Support for 5-field standard cron, 6/7-field variants with seconds and year, and Quartz-specific characters (#, L, W)
  • Recognition of @yearly/@monthly/@weekly/@daily/@hourly/@reboot shorthand expressions
  • 30+ bundled language translations, selectable per call or loaded individually to keep bundle size down
  • A zero-dependency runtime — nothing pulled into consuming projects’ node_modules at install time
  • A bundled CLI (cronstrue) for describing expressions directly from a terminal or scripts
  • Configurable output via options: verbose mode, 24-hour time, day/month start-index, leading-zero trimming, and AND vs OR combination of day-of-month/day-of-week

Common Use Cases

  • Rendering the human-readable schedule text next to a cron field in an admin dashboard or job-scheduling UI
  • Validating and previewing a user-entered cron expression before saving a scheduled task
  • Generating changelogs, tooltips, or documentation that explain what a deployed cron job actually does
  • Building CLI tools or scripts that need to print an expression’s meaning for logging or debugging
  • Displaying localized schedule descriptions in multi-language SaaS admin panels

Under The Hood

Architecture cronstrue follows a small, cleanly layered pipeline: CronParser (src/cronParser.ts) takes the raw expression, expands @-prefixed shorthand syntax (@daily, @yearly, @reboot, etc.) via parseSpecial(), splits it into fields with extractParts(), then normalizes and validates each field, delegating range checks to RangeValidator (rangeValidator.ts). The normalized parts are handed to ExpressionDescriptor (src/expressionDescriptor.ts), a static-factory class (ExpressionDescriptor.toString() / .initialize()) that walks the parsed fields and assembles a human-readable sentence, drawing vocabulary from a Locale object supplied by a LocaleLoader (enLocaleLoader.ts for the default English-only build, allLocalesLoader.ts for the full i18n bundle). StringUtilities centralizes small string-formatting helpers shared across the descriptor. The two entry modules (cronstrue.ts, cronstrue-i18n.ts) exist only to wire a specific LocaleLoader into ExpressionDescriptor.initialize() before exporting toString, so the two npm entry points (cronstrue vs cronstrue/i18n) are the same descriptor logic with a different locale set injected at import time. Options (options.ts) is a plain interface threaded through every layer rather than mutable shared state, keeping parsing and description generation stateless per call.

Tech Stack cronstrue is written entirely in TypeScript with a genuinely zero-dependency runtime — the dependencies field in package.json is empty, and the library only pulls in TypeScript, ts-loader, and webpack 5 with terser-webpack-plugin as devDependencies to compile the UMD bundle into dist/. Tests run on Mocha with Chai assertions via ts-node/register, executing directly against the TypeScript sources without a separate compile step. The docs site is a static demo page (docs/index.html) built with Handlebars templates, using pixl-xml/xml2js/marked as devDependencies to generate locale-comparison tables. Publishing is scripted through a webpack-cli build in prepublishOnly, producing a UMD bundle that works unmodified in Node (CommonJS), bundlers (ESM/webpack), or a plain <script> tag via the unpkg CDN. A thin CLI (bin/cli.js) wraps the compiled dist/cronstrue module for npx cronstrue "<expr>" usage.

Code Quality Test coverage is broad rather than superficial: test/cronstrue.ts alone runs a large number of individual cron-expression assertions grouped by feature (every/interval, day-of-week, Quartz #/L/W, @-shorthand, verbose mode), plus dedicated suites for i18n (test/i18n.ts, test/i18n-fr.ts), the parser (test/cronParser.ts), and string helpers (test/stringUtilities.ts). CI (.github/workflows/build.yml) runs npm test across multiple Node versions on every push and PR to main, though it stops at the test step — there’s no separate lint or type-check job wired into CI beyond what the TypeScript compiler catches during test execution. Prettier is configured inline in package.json but isn’t enforced as a CI gate. Types are used consistently throughout (strict interfaces for Options, Locale, LocaleLoader), and error handling favors throwing descriptive parse errors (via the throwExceptionOnParseError option) over silently swallowing malformed input. The small module count under src/ keeps the codebase easy to hold in your head.

What Makes It Unique cronstrue’s differentiator isn’t cron-to-English translation itself — several JavaScript libraries do that — but the combination of Quartz Job Scheduler syntax support (7-field expressions with seconds and year, plus #, L, W special characters that many cron-to-English tools skip) with genuine internationalization depth: 30+ bundled locales, selectable per call, with two distinct import strategies (cronstrue/i18n for all locales at once versus cronstrue/locales/[locale] for tree-shaking a single one). It was originally ported from a C# implementation (cron-expression-descriptor), and that lineage carries through to a family of ports in other languages the project links to — making cronstrue effectively the reference JavaScript implementation of a translation algorithm shared across a small ecosystem of language ports, rather than a one-off library.

Used by 33 apps in this directory

TypeScript
100%
Other

Activepieces

AI Assistants · Automation · Mcp

24,756

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript 100%
Updated 4 days ago
JavaScript
95%
MIT

AnythingLLM

AI Assistants · Automation · Developer Tools

66,533

The all-in-one AI platform for private document chat, no-code agents, and local LLMs with zero setup friction.

View details
90
Repo Health
78
Technical
64
Dependency
Built with
JavaScript 95%
Updated 6 days ago
Go
85%
Apache 2.0

Argo Workflows

Data Engineering · Devops

17,006

The most popular Kubernetes-native workflow engine for orchestrating containerized DAGs, ML pipelines, CI/CD, and parallel batch jobs at scale.

View details
96
Repo Health
90
Technical
68
Dependency
Built with
Go 85%
TypeScript 11%
Updated 4 days ago
Go
75%
AGPL 3.0

Coder

Code Editors · Developer Tools · Devops

16,729

Self-hosted cloud development environments and AI coding agents — defined in Terraform, connected via WireGuard, automatically shut down when idle.

View details
91
Repo Health
90
Technical
65
Dependency
Built with
Go 75%
TypeScript 23%
Updated 4 days ago
TypeScript
88%
MIT

DevTools-X

Developer Tools

1,534

41 offline-first developer utilities in a single 10MB cross-platform desktop app — no Electron, no cloud, no compromise.

View details
49
Repo Health
68
Technical
68
Dependency
Built with
TypeScript 88%
Updated 4 months ago
TypeScript
94%
AGPL 3.0

Element Web

Collaboration · Team Chat

13,518

A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.

View details
96
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 94%
Updated 5 days ago
PHP
66%
AGPL 3.0

EspoCRM

CRM · Ecommerce · Marketing

3,417

Open-source CRM platform with metadata-driven customization, field-level permissions, and a full REST API — deploy on your own infrastructure.

View details
96
Repo Health
72
Technical
63
Dependency
Built with
PHP 66%
JavaScript 23%
Updated 6 days ago
Python
65%
MIT

Flowfile

Data Engineering

363

Visual ETL that compiles to Polars — build pipelines on a canvas, export as standalone Python, and run anywhere without platform lock-in.

View details
83
Repo Health
81
Technical
66
Dependency
Built with
Python 65%
Vue 17%
TypeScript 17%
Updated 5 days ago
Ruby
67%
Other

GitLab

Developer Tools · Devops

24,552

The complete DevOps platform that unifies Git hosting, CI/CD, issue tracking, and security scanning into a single self-hostable application.

View details
87
Repo Health
86
Technical
67
Dependency
Built with
Ruby 67%
JavaScript 20%
Updated 4 days 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