UNPKG

632 BJavaScriptView Raw
1
2/**
3 * Determine the proxy settings configured by npm
4 *
5 * It's possible to configure npm to use a proxy different
6 * from the system defined proxy. This can be done via the
7 * `npm config` CLI or the `.npmrc` config file.
8 *
9 * If a proxy has been configured in this way we must
10 * tell request explicitly to use it.
11 *
12 * Otherwise we can trust request to the right thing.
13 *
14 * @return {String} the proxy configured by npm or an empty string
15 * @api private
16 */
17module.exports = function() {
18 return process.env.npm_config_https_proxy ||
19 process.env.npm_config_proxy ||
20 process.env.npm_config_http_proxy ||
21 '';
22};