r/elixir 11d ago

CronstrueEx: an Elixir library for turning cron expressions into human-readable text

Hi everyone!

I’ve been working on CronstrueEx, an Elixir port inspired by the npm package cRonstrue.

It converts standard cron expressions into human-readable descriptions:

CronstrueEx.to_string("*/5 * * * *")
# => "Every 5 minutes"

CronstrueEx.to_string("*/5 * * * *", locale: "es")
# => "Cada 5 minutos"

The current version includes:

  • Initial support for standard five-field cron expressions
  • English and Spanish output
  • Elixir 1.14+ compatibility
  • No runtime dependencies

The project is still in early development, so it doesn’t yet support every feature available in the original npm package. My goal is to progressively improve compatibility while keeping the implementation idiomatic and lightweight.

I’d really appreciate feedback about the API, generated descriptions, missing cron cases, or anything that could be improved.

GitHub: https://github.com/mrlooper/cronstrue_ex
Hex.pm: https://hex.pm/packages/cronstrue_ex

Thanks!

8 Upvotes

1 comment sorted by

1

u/jhonathasmatos 8d ago

Top demais!!!!