lacspace-cron

Explain, validate and preview cron expressions — in any timezone.

● Live · v0.2.0npmSource
terminal
npx lacspace-cron "0 9 * * 1-5"
What it does

Everything, in one command

lacspace-cron parses standard 5-field cron (and optional 6-field with seconds), explains it in a readable sentence, and computes the next runs using the built-in Intl API — so timezones, half-hour offsets and DST are handled correctly with no dependencies. It now understands the advanced day tokens L (last), W (nearest weekday) and # (nth weekday), Jenkins-style H (a seeded, deterministic spread, --seed), @every intervals and relative time, shows previous runs (--prev) or every run inside a window (--from/--to, --count-between), warns about DST skips/repeats, exports an .ics calendar (--ics), and compares two schedules for overlap. Great for double-checking a schedule before you ship it, or as a typed library inside your own scheduler.

Features

What's inside

Plain English

"0 9 * * 1-5" → "At 09:00, Monday through Friday."

Real validation

Field-specific errors (out of range, bad token) instead of a silently wrong schedule.

Next N runs

Preview the upcoming run times from now or any --from date.

Timezone-aware

Compute runs in any IANA zone via Intl — DST and odd offsets included.

Names & macros

JAN–DEC, SUN–SAT, and @daily / @hourly / @weekly / @monthly / @yearly.

Typed library

parseCron, explainCron, nextRuns, isValidCron and matchesCron.

Advanced tokens (L/W/#/H)

Last day, nearest weekday, nth weekday, and Jenkins H spread — seeded and deterministic.

Runs in a window

Previous runs (--prev), every run between --from/--to, and --count-between totals.

.ics export

--ics writes an .ics calendar of the upcoming runs — drop it into any calendar app.

DST-safe

Warns when a run is skipped or repeated across a DST change; compare checks two schedules for overlap.

How to use

Copy, paste, done

Real commands and snippets — from a one-liner to the typed library.

Last Friday, relative
terminal
lacspace-cron "0 9 * * 5L" --relative

Explains the 5L token and prints runs as "in 3 days" style.

Jenkins H spread
terminal
lacspace-cron "H H(2-5) * * *" --seed nightly-etl

Deterministic H placement seeded by a name — same seed, same times.

@every interval
terminal
lacspace-cron "@every 90s" --next 4

Fixed-interval schedules, not just cron fields.

Export a calendar
terminal
lacspace-cron "0 9 * * 1-5" --next 10 --ics standup.ics

Writes the next 10 runs as an .ics file.

Check two schedules for overlap
terminal
lacspace-cron compare "0 * * * *" "*/15 * * * *"

Reports when the two schedules fire at the same time.

Good for

What people build with it

Sanity-check a crontab before deploy

Show the next run time in a dashboard

Validate user-entered schedules

Drive your own job scheduler

Start now

Run lacspace-cron today

Free, open-source, no API keys. It's a CLI and a typed library.

terminal
npx lacspace-cron "0 9 * * 1-5"