Hacker News new | ask | show | jobs
by brodo 1229 days ago
My major pain point was that I had big JSON files inside my .env files. We use Cloud Foundry at work and it uses plenty of these for configuration.

I wrote a small Rust tool called ‘json_env’[0] to read JSON files and supply them as ENV vars to a program. I’m working on it in my free time and eventually want to also replace direnv with it. TOML and YAML support is also planned.

[0] https://github.com/brodo/json_env

1 comments

But why? Is it not easier to store the JSON as file and have an env variable that points to it?

JSON as env value is utter madness.

Having no config files is part of the 12 factors [0]. All cloud providers I have worked with adhere to this.

[0]: https://12factor.net

12factor doesn't mandate that you put the entirety of a JSON file into a single variable. That is what you implied with your original comment.