Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@getgauge/cli

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@getgauge/cli - npm Package Compare versions

Comparing version 1.5.0 to 1.5.1

4

package.json

@@ -32,5 +32,5 @@ {

"dependencies": {
"unzipper": "^0.9.3"
"adm-zip": "^0.5.10"
},
"version": "1.5.0"
"version": "1.5.1"
}

@@ -7,3 +7,3 @@ #!/usr/bin/env node

path = require("path"),
unzip = require('unzipper'),
AdmZip = require('adm-zip'),
https = require('https'),

@@ -13,10 +13,26 @@ packageJsonPath = path.join(__dirname, "..", "package.json"),

var extractZipArchive = function(buffer) {
return new Promise(function(resolve, reject) {
try {
const zip = new AdmZip(buffer);
zip.extractAllTo(path.normalize(binPath), true, true);
resolve();
} catch (err) {
reject(new Error(`Failed to extract archive from buffer: ${err.message}`));
}
})
}
var downloadFollowingRedirect = function(url, resolve, reject) {
https.get(url, { headers: { 'accept-encoding': 'gzip,deflate' } }, res => {
if (res.statusCode >= 300 && res.statusCode < 400) {
downloadFollowingRedirect(res.headers.location, reject, resolve);
} else if (res.statusCode > 400) {
console.error(`Unable to download '${url}' : ${res.statusCode}-'${res.statusMessage}'`);
downloadFollowingRedirect(res.headers.location, resolve, reject);
} else if (res.statusCode >= 400) {
reject(new Error(`Unable to download '${url}' : ${res.statusCode}-'${res.statusMessage}'`));
} else {
res.pipe(unzip.Extract({ path: path.normalize(binPath) })).on('error', reject).on('end', resolve);
const chunks = [];
res
.on('data', chunk => chunks.push(chunk))
.on('end', () => resolve(Buffer.concat(chunks)))
.on('error', reject);
}

@@ -37,2 +53,3 @@ });

})
.then(extractZipArchive)
};

@@ -39,0 +56,0 @@

@@ -28,3 +28,8 @@ #!/usr/bin/env node

}
resolve(JSON.parse(data).version);
const pkg = JSON.parse(data);
if (pkg.version) {
resolve(pkg.version);
} else {
reject(new Error("Unable to find version in package.json."));
}
})

@@ -31,0 +36,0 @@ });

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