5 ms·
Dotenvx: A better dotenv – from the creator of `dotenv`
- bdcravens 2y agoSignificant discussions here 14 days ago: (354 points) https://news.ycombinator.com/item?id=40789353 https://news.ycombinator.com/item?id=40789353
- cheptsov 2y agoSorry if the question is stupid but maybe someone can help understand it better. I’m using direnv (1). I like the tool for its simplicity. How are dotenv or dotenvx different? (1) https://direnv.net/ https://direnv.net/
- sshine 2y agoI also came to promote direnv (and nix-direnv) since I have just started using them: they are a little more automatic and resemble python’s venv. One thing dotenv does is that it lets you load environment variables in your program whether they are in your .envrc or in your environment.
- forrestthewoods 2y agoI hate environment variables so much. They’re the source of so much pain and suffering. I never write code that uses envvars. Always use cmdline args or a config file. If I were designing an OS I’d do everything in my power to not have an envvar API. It’s probably not possible, but damnit I’d try
- syndicatedjelly 2y agoI was about to comment something like, “you’re strange”, but then I remembered how I spent the last several nights debugging server issues that basically boiled down to badly set environment variables. I added code to the startup script to explicitly throw when the env variables are not set/empty, but this papers over a problem and just makes debugging easier. It doesn’t solve it.
- flashgordon 2y agoId like to hear more. I've also felt this way but have fallen back on them (plus been too scared to question the conventional wisdom).
- cheptsov 2y agoEnvironment variables are especially convenient IMO for parameterizing Docker images when running containers, e.g. using Docker or Kubernetes, etc. Also, for configuring all sort of credentials for libraries, e.g. AWS, WandB, HuggingFace, etc.
- forrestthewoods 2y agoI also hate Docker and think it only exists because modern design principles have failed. Reliably launching a software program shouldn't be difficult. But instead we've chosen to rely on a big ugly fragile ball of global system/environment state. And the only way to even launch a program is with heavyweight containers. Running a computer program shouldn't require a Docker image. Which in turn alleviates the need to use gross environment variables.
- ramesh31 2y agoA wonderful little library that will very hopefully finally be obsolete when Node env-file leaves experimental.
- deleted 2y ago[deleted]