




















I built this because I can never remember cron's syntax. The ordering of the slots, what / vs , vs - do, day-of-week being 0-indexed, and how many fields there even are. "Every 5 minutes" is trivial compared to /5 * * * * which I just had to stop and count the stars to make sure I hadn't forgotten one. The format requires me to second guess myself every. single. time.
cronstrue already does cron → English well, but I wanted both directions for this UX plus the next-run preview in one small library, so cron-naturally translates both ways. Type "every weekday at 9am" and it'll return 0 9 * * 1-5. Paste a cron and you'll see a field-by-field breakdown plus the next few run times in your timezone so you can see the real world implications.
It's deterministic (i.e. it uses regexes) so there's no need for an LLM, an API key, latency, etc. It can run entirely client-side and is powering the demo page natively. It's licensed under MIT with no runtime deps.
Pulled it out of a product I'm building where users set workflow schedules in plain English and these features all made the UX really intuitive.
Demo: https://rillsai.github.io/cron-naturally Repo: https://github.com/rillsai/cron-naturally npm: https://www.npmjs.com/package/cron-naturally
Feedback (and translations) welcome!
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。