Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
When reading the file, the environment variables will be obtained from the URL and populate the environment.
This is what I had in mind when designing the import functionality for deon [1].
Being able to import also makes it easy to have a .base, a .production, a .local setup, and combine them accordingly.
[1] https://github.com/plurid/deon
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
I really like the Gura format (https://github.com/gura-conf/gura). Seems to combine the best of yaml, json, and toml for the use case of human created configuration files.
I've also seen the Dhall configuration language (https://dhall-lang.org/) mentioned.
> "CLI args are usually passed around explicitly" -- I think this is a pro, not a con.
Sure; I never said it's a con. They have different characteristics, and are both useful in certain situations :)
> I think the correct term for "things the caller knows better than the implementor" are parameters.
True; that's also the name Racket gives to dynamically-scoped variables https://docs.racket-lang.org/guide/parameterize.html
In fact, Racket uses a parameter (dynamically-scoped variable) to store the environment. This is actually slightly annoying, since the parameter is one big hashmap of all the env vars; but I usually want to override them individually. One of my Racket projects actually defines a helper function to override individual env vars makes a copies all the other environment ( made a are contained in a parameterhttps://github.com/Warbo/theory-exploration-benchmarks/blob/...