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

binstall

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binstall - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

33

binstall.js

@@ -8,4 +8,7 @@ var path = require("path");

function binstall(url, tarArgs, options) {
var verbose = typeof options === "object" && options.verbose;
options = options || {};
var verbose = options.verbose;
var verify = options.verify;
return new Promise(function(resolve, reject) {

@@ -17,3 +20,11 @@ var untar = tar.Extract(tarArgs)

.on("end", function() {
resolve("Successfully downloaded and processed " + url);
var successMessage = "Successfully downloaded and processed " + url;
if (verify) {
verifyContents(verify).then(function() {
resolve(successMessage);
}).catch(reject);
} else {
resolve(successMessage);
}
});

@@ -47,2 +58,20 @@

function verifyContents(files) {
return Promise.all(
files.map(function(filePath) {
return new Promise(function(resolve, reject) {
fs.stat(filePath, function(err, stats) {
if (err) {
reject(filePath + " was not found.");
} else if (!stats.isFile()) {
reject(filePath + " was not a file.");
} else {
resolve();
}
});
});
})
);
}
module.exports = binstall;

2

package.json
{
"name": "binstall",
"version": "1.0.0",
"version": "1.1.0",
"description": "Install binaries via npm.",

@@ -5,0 +5,0 @@ "main": "binstall.js",

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