Socket
Socket
Sign inDemoInstall

@saucelabs/bin-wrapper

Package Overview
Dependencies
Maintainers
23
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@saucelabs/bin-wrapper - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

22

dist/download.js

@@ -13,2 +13,3 @@ "use strict";

const tar_1 = __importDefault(require("./archive/tar"));
const https_proxy_agent_1 = require("https-proxy-agent");
async function downloadAndUnpack(url, filepath, binary, options = {}) {

@@ -24,7 +25,22 @@ const payload = await download(url, options);

exports.downloadAndUnpack = downloadAndUnpack;
function getHttpsProxyValue() {
for (const k of Object.keys(process.env)) {
if (k.toUpperCase() === "HTTPS_PROXY") {
return process.env[k];
}
}
return undefined;
}
async function download(url, options) {
return await axios_1.default.get(url.toString(), {
const opts = {
headers: options.headers,
responseType: 'arraybuffer',
headers: options.headers,
}).then((res) => {
};
const httpsProxy = getHttpsProxyValue();
if (httpsProxy && url.protocol === 'https:') {
opts.httpsAgent = new https_proxy_agent_1.HttpsProxyAgent(httpsProxy);
// Disable axios' native proxy, because we are letting HttpsProxyAgent handle it.
opts.proxy = false;
}
return await axios_1.default.get(url.toString(), opts).then((res) => {
return res.data;

@@ -31,0 +47,0 @@ }).catch((err) => {

2

package.json
{
"name": "@saucelabs/bin-wrapper",
"version": "0.2.0",
"version": "0.3.0",
"description": "Fetches and runs a binary",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc