cron-parser

Parse, validate, and iterate cron expressions in Node.js with full timezone and DST support.

Library
npm
v5.10.0
1,489stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
86/100Excellent
Development Activity96
Maintenance96
Community64
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture85
Code Quality88
Innovation84
Learning Curve82

cron-parser is a mature, dependency-light TypeScript library for parsing and manipulating cron expressions in Node.js. It turns a crontab string into an iterable interval you can step forward and backward through to compute the next and previous scheduled run times, with correct handling of timezones and daylight-saving transitions via Luxon.

Beyond basic five-field crontab syntax, it supports optional seconds, predefined shortcuts like @daily and @weekly, special characters (L for last day, # for nth weekday, H for hash-randomized values), strict validation mode, and reading entire crontab files. It is the parsing engine underneath many popular Node.js job-scheduling tools.

What You Get

  • A CronExpressionParser that parses standard and 6-field (with seconds) crontab strings into an iterable interval
  • next() / prev() / take() iteration plus for…of support for computing scheduled run times in either direction
  • Timezone and daylight-saving-aware date calculation backed by Luxon, configurable per expression
  • Support for predefined aliases (@daily, @weekly, @hourly), and special characters L, #, and H
  • A CronFileParser for reading crontab files (async and sync), returning variables, expressions, and errors
  • Strict validation mode and first-class TypeScript types throughout

Common Use Cases

  • Computing the next run time of a scheduled job from a user-supplied cron string
  • Validating cron expressions entered in an admin UI or configuration file before saving
  • Powering job schedulers, task queues, and reminder systems that accept cron syntax
  • Displaying a human-facing list of upcoming run times for a recurring task

Under The Hood

Architecture - Parsing flows through src/CronExpressionParser.ts, which normalizes predefined aliases and splits a raw string into fields, each modeled by a dedicated class in src/fields/ (CronSecond, CronMinute, CronHour, CronDayOfMonth, CronMonth, CronDayOfWeek) extending the abstract CronField base. Parsed fields are held in a CronFieldCollection, and a CronExpression wraps that collection to expose the iterator (next/prev/take), computing candidate dates with an internal CronDate and validating them against optional start/end bounds; CronFileParser layers crontab-file reading on top of the same engine.

Tech Stack - Written in TypeScript (targeting Node.js >= 18) with a single runtime dependency, Luxon, used for timezone-aware and DST-correct date arithmetic. The build compiles to CommonJS via tsc with emitted type declarations; tooling includes Jest for tests, ESLint and Prettier for style, tsd for type tests, Husky/lint-staged for pre-commit hooks, and typedoc for API docs.

Code Quality - The codebase is cleanly decomposed with one class per cron field, private class fields for encapsulation, and thorough JSDoc. It ships an extensive Jest suite in tests/ covering the parser, each field, dates, the file parser, and the random/hash helper, with coverage badges generated in CI, plus dedicated type tests via tsd. Naming is consistent and the public surface is fully typed.

API Design - The entry point is a single CronExpressionParser.parse(expression, options) call returning an iterable interval, which keeps first use minimal while options (currentDate, startDate, endDate, tz, strict, hashSeed) cover advanced needs. Iteration reads naturally through next(), prev(), take(n), and for...of, errors surface as thrown exceptions with clear messages, and the README documents field values, special characters, and edge cases in depth.

Used by 34 apps in this directory

TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
Go
85%
Apache 2.0

Argo Workflows

Devops · Data Engineering

16,916

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
70
Dependency
Built with
Go85%
TypeScript11%
Updated today
Go
76%
AGPL 3.0

Coder

Devops · Developer Tools · Code Editors

14,199

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

View details
93
Repo Health
90
Technical
71
Dependency
Built with
Go76%
TypeScript22%
Updated today
TypeScript
88%
MIT

DevTools-X

Developer Tools

1,532

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

View details
51
Repo Health
68
Technical
68
Dependency
Built with
TypeScript88%
Updated 2 months ago
TypeScript
50%
Other

Dify

No Code Platforms · AI Development · Developer Tools

152,883

Visual LLM workflow platform with RAG pipelines, agent capabilities, and model management for building production AI applications.

View details
92
Repo Health
85
Technical
71
Dependency
Built with
TypeScript50%
Python47%
Updated today
TypeScript
92%
AGPL 3.0

Documenso

Digital Signiture

14,603

Self-hosted, open-source DocuSign alternative with legally binding PDF signatures, multi-party workflows, and a full REST and tRPC API.

View details
93
Repo Health
79
Technical
72
Dependency
Built with
TypeScript92%
Updated today
TypeScript
89%
Other

FastGPT

AI Agents · AI Development

29,387

Build, debug, and deploy knowledge-based AI agents with a visual workflow editor, RAG retrieval, and support for any OpenAI-compatible LLM.

View details
93
Repo Health
84
Technical
70
Dependency
Built with
TypeScript89%
Updated today
TypeScript
97%
Other

GrowthBook

Developer Tools · Analytics · Monitoring

8,138

Open source feature flags, A/B testing, and warehouse-native experimentation that queries your existing data infrastructure—no data movement required.

View details
92
Repo Health
85
Technical
66
Dependency
Built with
TypeScript97%
Updated today
TypeScript
97%
Other

Infisical

Security · Devops

28,838

The open-source platform for secrets, certificates, privileged access, and AI agent security — all in one self-hostable system.

View details
91
Repo Health
84
Technical
66
Dependency
Built with
TypeScript97%
Updated today

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