Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/utils
diff options
context:
space:
mode:
authorzhaoxuxu <zhaoxuxujc@gmail.com>2020-09-18 13:21:07 +0300
committerisaacs <i@izs.me>2020-09-30 22:14:35 +0300
commit3b417055cf07c4ef8e4c5063f00d3c24b5f5cbd2 (patch)
treea506afd424701db1580ffee6fca3bab52a8028b6 /lib/utils
parentfef2646347bbb8ccfa9239cc9d99debae002552b (diff)
add proxy
PR-URL: https://github.com/npm/cli/pull/1859 Credit: @badeggg Close: #1859 Reviewed-by: @isaacs EDIT: changed flatOptions.noproxy to flatOptions.noProxy, since make-fetch-happen reads it from the camel-cased property.
Diffstat (limited to 'lib/utils')
-rw-r--r--lib/utils/flat-options.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/utils/flat-options.js b/lib/utils/flat-options.js
index 54ba22d6c..721bbbde7 100644
--- a/lib/utils/flat-options.js
+++ b/lib/utils/flat-options.js
@@ -209,7 +209,13 @@ const flatOptions = npm => npm.flatOptions || Object.freeze({
...getScopesAndAuths(npm),
// npm fund exclusive option to select an item from a funding list
- which: npm.config.get('which')
+ which: npm.config.get('which'),
+
+ // socks proxy can be configured in https-proxy or proxy field
+ // note that the various (HTTPS_|HTTP_|)PROXY environs will be
+ // respected if this is not set.
+ proxy: npm.config.get('https-proxy') || npm.config.get('proxy'),
+ noProxy: npm.config.get('noproxy')
})
const getPreferOnline = npm => {