@electron/get
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -11,17 +11,12 @@ "use strict"; | ||
try { | ||
// Code originally from https://github.com/yeoman/yo/blob/b2eea87e/lib/cli.js#L19-L28 | ||
const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10); | ||
if (MAJOR_NODEJS_VERSION >= 10) { | ||
// See: https://github.com/electron/get/pull/214#discussion_r798845713 | ||
const env = utils_1.getEnv('GLOBAL_AGENT_'); | ||
utils_1.setEnv('GLOBAL_AGENT_HTTP_PROXY', env('HTTP_PROXY')); | ||
utils_1.setEnv('GLOBAL_AGENT_HTTPS_PROXY', env('HTTPS_PROXY')); | ||
utils_1.setEnv('GLOBAL_AGENT_NO_PROXY', env('NO_PROXY')); | ||
// `global-agent` works with Node.js v10 and above. | ||
require('global-agent').bootstrap(); | ||
} | ||
else { | ||
// `global-tunnel-ng` works with Node.js v10 and below. | ||
require('global-tunnel-ng').initialize(); | ||
} | ||
// See: https://github.com/electron/get/pull/214#discussion_r798845713 | ||
const env = utils_1.getEnv('GLOBAL_AGENT_'); | ||
utils_1.setEnv('GLOBAL_AGENT_HTTP_PROXY', env('HTTP_PROXY')); | ||
utils_1.setEnv('GLOBAL_AGENT_HTTPS_PROXY', env('HTTPS_PROXY')); | ||
utils_1.setEnv('GLOBAL_AGENT_NO_PROXY', env('NO_PROXY')); | ||
/** | ||
* TODO: replace global-agent with a hpagent. @BlackHole1 | ||
* https://github.com/sindresorhus/got/blob/HEAD/documentation/tips.md#proxying | ||
*/ | ||
require('global-agent').bootstrap(); | ||
} | ||
@@ -28,0 +23,0 @@ catch (e) { |
@@ -9,17 +9,12 @@ import * as debug from 'debug'; | ||
try { | ||
// Code originally from https://github.com/yeoman/yo/blob/b2eea87e/lib/cli.js#L19-L28 | ||
const MAJOR_NODEJS_VERSION = parseInt(process.version.slice(1).split('.')[0], 10); | ||
if (MAJOR_NODEJS_VERSION >= 10) { | ||
// See: https://github.com/electron/get/pull/214#discussion_r798845713 | ||
const env = getEnv('GLOBAL_AGENT_'); | ||
setEnv('GLOBAL_AGENT_HTTP_PROXY', env('HTTP_PROXY')); | ||
setEnv('GLOBAL_AGENT_HTTPS_PROXY', env('HTTPS_PROXY')); | ||
setEnv('GLOBAL_AGENT_NO_PROXY', env('NO_PROXY')); | ||
// `global-agent` works with Node.js v10 and above. | ||
require('global-agent').bootstrap(); | ||
} | ||
else { | ||
// `global-tunnel-ng` works with Node.js v10 and below. | ||
require('global-tunnel-ng').initialize(); | ||
} | ||
// See: https://github.com/electron/get/pull/214#discussion_r798845713 | ||
const env = getEnv('GLOBAL_AGENT_'); | ||
setEnv('GLOBAL_AGENT_HTTP_PROXY', env('HTTP_PROXY')); | ||
setEnv('GLOBAL_AGENT_HTTPS_PROXY', env('HTTPS_PROXY')); | ||
setEnv('GLOBAL_AGENT_NO_PROXY', env('NO_PROXY')); | ||
/** | ||
* TODO: replace global-agent with a hpagent. @BlackHole1 | ||
* https://github.com/sindresorhus/got/blob/HEAD/documentation/tips.md#proxying | ||
*/ | ||
require('global-agent').bootstrap(); | ||
} | ||
@@ -26,0 +21,0 @@ catch (e) { |
{ | ||
"name": "@electron/get", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Utility for downloading artifacts from different versions of Electron", | ||
@@ -94,4 +94,3 @@ "main": "dist/cjs/index.js", | ||
"optionalDependencies": { | ||
"global-agent": "^3.0.0", | ||
"global-tunnel-ng": "^2.7.1" | ||
"global-agent": "^3.0.0" | ||
}, | ||
@@ -98,0 +97,0 @@ "resolutions": { |
@@ -137,7 +137,2 @@ # @electron/get | ||
Downstream packages should utilize the `initializeProxy` function to add HTTP(S) proxy support. If | ||
the environment variable `ELECTRON_GET_USE_PROXY` is set, it is called automatically. A different | ||
proxy module is used, depending on the version of Node in use, and as such, there are slightly | ||
different ways to set the proxy environment variables. For Node 10 and above, | ||
[`global-agent`](https://github.com/gajus/global-agent#environment-variables) is used. Otherwise, | ||
[`global-tunnel-ng`](https://github.com/np-maintain/global-tunnel#auto-config) is used. Refer to the | ||
appropriate linked module to determine how to configure proxy support. | ||
the environment variable `ELECTRON_GET_USE_PROXY` is set, it is called automatically. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
92210
1341
138