kevva / get-proxy

Get configured proxy
MIT License
15 stars 2 forks source link

Using npm_config_* environment variables instead of sourcing npmrc #2

Closed alash3 closed 7 years ago

alash3 commented 9 years ago

Hi,

I noticed you are using only the .npmrc file, but not the values that can be passed to npm via cli arguments. This PR switches that. Let me know your thoughts.

Thanks, Albert

kevva commented 9 years ago

Why would you remove the ones from .npmrc? We can have both.

alash3 commented 9 years ago

The npmconfig* environment variables take the .npmrc into consideration, so they aren't removed, they are replaced.

sindresorhus commented 9 years ago

npm_config env vars are only available when the code is run as in a npm run script. It should have both.

alash3 commented 9 years ago

I disagree; npm-specific configurations need to stay npm specific. The proxy settings used when not running as an npm script should respect environment variables.

The current design of get-proxy does not support the no_proxy environment variable. Are you planning on supporting that?

kevva commented 7 years ago

6 will take read CLI arguments (when ran as a npm script). Going to close this in favor of that. Feel free to open new issues if you want more variables or taking CLI arguments outside of npm scripts into account.