Socket
Socket
Sign inDemoInstall

node-pre-gyp

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-pre-gyp - npm Package Compare versions

Comparing version 0.1.8 to 0.1.9

.travis.yml

5

bin/node-pre-gyp.js

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

}
console.log.apply(console, [].slice.call(arguments, 1))
var args_array = [].slice.call(arguments, 1)
if (args_array.length) {
console.log.apply(console, args_array)
}
// now run the next command in the queue

@@ -83,0 +86,0 @@ process.nextTick(run)

2

lib/node-pre-gyp.js

@@ -21,3 +21,3 @@

'rebuild',
'publish'
'package'
]

@@ -24,0 +24,0 @@ , aliases = {

@@ -122,4 +122,3 @@

badDownload = true
callback(new Error(res.statusCode + ' status code downloading tarball'))
return
return callback(new Error(res.statusCode + ' status code downloading tarball'))
}

@@ -135,36 +134,48 @@ // start unzipping and untaring

var package_json = JSON.parse(fs.readFileSync('./package.json'));
if (gyp.opts['build_from_source'] && (
(gyp.opts['build_from_source'] === true || gyp.opts['build_from_source'] === 'true') ||
(gyp.opts['build_from_source'] === package_json.name))) {
// @TODO = if run via npm dashes will become underscore - why?
var command_line_opts = (typeof(gyp.opts.argv.original) === 'string') ? JSON.parse(gyp.opts.argv).original : gyp.opts.argv.original || [];
command_line_opts = command_line_opts.filter(function(opt) { return opt.length > 2 && opt.slice(0,2) == '--'});
var node_gyp_args = ['rebuild'].concat(command_line_opts);
var source_build = gyp.opts['build-from-source'] || gyp.opts['build_from_source'];
if (source_build === package_json.name ||
source_build === true ||
source_build === 'true') {
log.info('rebuild','requesting source compile');
return compile.run_gyp(['rebuild'],gyp.opts,callback);
compile.run_gyp(node_gyp_args,gyp.opts,function(err,opts) {
return callback(err);
});
} else {
versioning.evaluate(package_json, gyp.opts, function(err,opts) {
if (err) return callback(err);
var from = package_json.binary.remote_uri + '/' + opts.versioned;
var to = package_json.binary.module_path;
var binary_module = path.join(to,opts.module_name + '.node');
if (existsAsync(binary_module,function(found) {
if (found) {
console.log('['+package_json.name+'] Success: "' + binary_module + '" is already installed');
return callback();
} else {
place_binary(from,to,opts,function(err) {
if (err) {
log.info('build','source compile required');
compile.run_gyp(node_gyp_args,opts,function(err,opts) {
return callback(err);
});
} else {
test_binary(opts,function(err) {
if (err) {
log.info("Testing pre-built binary failed, falling back to source compile: ("+err.message+")");
compile.run_gyp(node_gyp_args,opts,function(err,opts) {
return callback(err);
});
}
console.log('['+package_json.name+'] Success: "' + binary_module + '" is installed');
return callback();
});
};
});
}
}));
});
}
versioning.evaluate(package_json, gyp.opts, function(err,opts) {
if (err) return callback(err);
var from = package_json.binary.remote_uri + '/' + opts.versioned;
var to = package_json.binary.module_path;
var binary_module = path.join(to,opts.module_name+'.node');
if (existsAsync(binary_module,function(found) {
if (found) {
log.info('install','Sweet: "'+binary_module+'" is installed!');
callback();
} else {
place_binary(from,to,opts,function(err) {
if (err) {
log.info('build','source compile required');
compile.run_gyp(['rebuild'],opts,callback);
} else {
test_binary(opts,function(err) {
if (err) {
log.info("Testing pre-built binary failed, falling back to source compile: ("+err.message+")");
compile.run_gyp(['rebuild'],opts,callback);
}
log.info('rebuild','Sweet: "'+binary_module+'" was successfully built!');
return callback();
});
};
});
}
}));
});
}

@@ -22,3 +22,3 @@

}
var cmd = cp.spawn(shell_cmd,args, {cwd: undefined, env: process.env, customFds: [ 0, 1, 2]});
var cmd = cp.spawn(shell_cmd, args, {cwd: undefined, env: process.env, customFds: [ 0, 1, 2]});
cmd.on('error', function (err) {

@@ -25,0 +25,0 @@ if (err) {

{
"name": "node-pre-gyp",
"description": "Node.js native addon binary install tool",
"version": "0.1.8",
"version": "0.1.9",
"keywords": [

@@ -28,7 +28,11 @@ "native",

"tar": "0",
"tar-pack":"*"
"tar-pack":"*",
"mkdirp":"*"
},
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test":"./test.sh"
}
}

@@ -12,2 +12,4 @@ # node-pre-gyp

[![Build Status](https://secure.travis-ci.org/springmeyer/node-pre-gyp.png)](https://travis-ci.org/springmeyer/node-pre-gyp)
# Design

@@ -36,4 +38,3 @@

```js
mkdir stage
node-pre-gyp publish
node-pre-gyp package
```

@@ -40,0 +41,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