-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Description
Is there an existing issue for this?
- I have searched the existing issues
This is a CLI Docs Problem, not another kind of Docs Problem.
- This is a CLI Docs Problem.
Description of Problem
This is about the ambiguity regarding the case of the environment variables.
If we take NPM_CONFIG_USERCONFIG as the example.
Here in the docs, it's referred as NPM_CONFIG_USERCONFIG, in uppercase:
per-user configuration file (defaults to
$HOME/.npmrc; configurable via CLI
option--userconfigor environment variable$NPM_CONFIG_USERCONFIG)
However later in the same docs, and in the source, it's referred as npm_config_userconfig, in lowercase:
This may be overridden by the
npm_config_userconfigenvironment variable
or the--userconfigcommand line option
I understand that both uppercase NPM_CONFIG_USERCONFIG and lowercase npm_config_userconfig work, because internally the environment variable names are converted to lowercase.
But what happens if both NPM_CONFIG_USERCONFIG and npm_config_userconfig are set? Or even if there's alsoNPM_CONFIG_userconfig? I haven't done a thorough testing but I bet the result would be interesting and/or surprising.
Can we follow the convention and always refer to environment variable names in uppercase? That is already the de-facto standard. Thank you!
Potential Solution
Always use environment variables in uppercase.