logoalt Hacker News

whydid12/08/20242 repliesview on HN

Why do JavaScript programmers call ini files "environment variables" ?


Replies

cstrahan12/08/2024

They don’t.

I’m guessing you navigated to the https://mise.jdx.dev/environments.html page and saw the TOML syntax (which looks an awful lot like INI), and confused yourself.

Mise (like a lot of software) uses TOML as the format for its config files (as opposed to something like JSON). Mise reads that config, to automatically export environment variables on a per directory tree basis.

When the docs refer to environment variables, they very literally do mean environment variables. The values of which are taken from a format that resembles INI, as you have noticed.

Izkata12/08/2024

Environment variables are key/value pairs that are passed from parent process to child process when the child is first created. A convention has also arisen where these can be put into environment files so the overarching system (for example, docker) can load them from a consistent place (without having to add them to your shell and risk leakage across projects) and then pass them down to child processes in typical environment variable fashion.

Also there are no sections like there are in ini files.