Socket
Socket
Sign inDemoInstall

bin-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bin-wrapper - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

30

bin-wrapper.js
'use strict';
var download = require('download');
var exec = require('child_process').exec;
var fs = require('fs');
var isbin = require('isbin');
var mout = require('mout');
var os = require('os');
var path = require('path');

@@ -26,3 +28,4 @@ var spawn = require('child_process').spawn;

this.url = this.opts.url;
this.source = this.opts.source;
this.src = this.opts.src;
this.buildScript = this.opts.buildScript;
}

@@ -63,2 +66,27 @@

BinWrapper.prototype.build = function (cb) {
var self = this;
var tmpDir = os.tmpdir ? os.tmpdir() : os.tmpDir();
var tmp = path.join(tmpDir, this.name);
var get = download(this.src, tmp, { extract: true, strip: '1' });
if (!cb || !mout.lang.isFunction(cb)) {
cb = function () {};
}
if (!isbin('make')) {
throw new Error('failed to find make');
}
return get.on('close', function () {
exec(self.buildScript, { cwd: tmp }, function (err) {
if (err) {
return cb(err);
}
return cb();
});
});
};
/**

@@ -65,0 +93,0 @@ * Test if a binary is working by checking its exit code

2

package.json
{
"name": "bin-wrapper",
"version": "0.1.2",
"version": "0.1.3",
"description": "Binary wrapper for Node.js that makes your programs seamlessly available as local dependencies",

@@ -5,0 +5,0 @@ "keywords": [

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