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

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.2.5 to 0.2.6

test/app3/deps/include/mylib/interface.h

3

lib/build.js

@@ -10,2 +10,3 @@

function build(gyp, argv, callback) {
var node_gyp_command = argv.length && argv[0] == 'rebuild' ? argv[0] : 'build';
var package_json = JSON.parse(fs.readFileSync('./package.json'));

@@ -16,3 +17,3 @@ // options look different depending on whether node-pre-gyp is called directly

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 node_gyp_args = [node_gyp_command].concat(command_line_opts);
compile.run_gyp(node_gyp_args,gyp.opts,function(err,opts) {

@@ -19,0 +20,0 @@ return callback(err);

@@ -106,3 +106,3 @@

function do_build(gyp,argv,callback) {
gyp.todo.push( { name: 'build', args: [] } );
gyp.todo.push( { name: 'build', args: ['rebuild'] } );
process.nextTick(callback);

@@ -128,9 +128,27 @@ }

if (found) {
console.log('['+package_json.name+'] Success: "' + binary_module + '" already installed');
console.log('Run pass --build-from-source to compile');
return callback();
test_binary.validate(opts,function(err) {
if (err) {
console.error(err.message);
log.error("Testing local pre-built binary failed, attempting to re-download");
place_binary(from,to,opts,function(err) {
if (err && fallback_to_build) {
log.info('build','source compile required');
return do_build(gyp,argv,callback);
} else if (err) {
return callback(err);
} else {
console.log('['+package_json.name+'] Success: "' + binary_module + '" is installed');
return callback();
}
});
} else {
console.log('['+package_json.name+'] Success: "' + binary_module + '" already installed');
console.log('Run pass --build-from-source to compile');
return callback();
}
});
} else {
place_binary(from,to,opts,function(err) {
if (err && fallback_to_build) {
log.info('build','source compile required');
log.error('Source compile required: ' + err.message);
return do_build(gyp,argv,callback);

@@ -142,3 +160,4 @@ } else if (err) {

if (err && fallback_to_build) {
log.info("Testing pre-built binary failed, falling back to source compile: ("+err.message+")");
console.error(err.message);
log.error("Testing pre-built binary failed, attempting to re-download");
return do_build(gyp,argv,callback);

@@ -145,0 +164,0 @@ } else if (err) {

@@ -9,5 +9,5 @@

{ name: 'clean', args: [] }
, { name: 'build', args: [] }
, { name: 'build', args: ['rebuild'] }
)
process.nextTick(callback)
}

@@ -34,2 +34,3 @@

args.push(opts.module_main);
log.info("validate","Running test command: '" + shell_cmd + ' ' + args.join(' '));
cp.execFile(shell_cmd, args, function(err, stdout, stderr) {

@@ -36,0 +37,0 @@ if (err || stderr) {

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

@@ -6,0 +6,0 @@ "native",

@@ -0,3 +1,7 @@

var path = require('path');
var pkg = require('./package.json');
var assert = require('assert');
var app1 = require('./build/Release/app1.node');
assert.ok(app1);
var binding = './' + path.join(pkg.binary.module_path,pkg.binary.module_name + '.node');
var app = require(binding);
assert.ok(app);

@@ -0,3 +1,7 @@

var path = require('path');
var pkg = require('./package.json');
var assert = require('assert');
var app2 = require('./lib/app2.node');
assert.ok(app2);
var binding = './' + path.join(pkg.binary.module_path,pkg.binary.module_name + '.node');
var app = require(binding);
assert.ok(app);

@@ -0,3 +1,8 @@

var path = require('path');
var pkg = require('./package.json');
var assert = require('assert');
var app3 = require('./lib/app3.node');
assert.equal(app3.hello(),"hello");
var binding = './' + path.join(pkg.binary.module_path,pkg.binary.module_name + '.node');
var app = require(binding);
assert.ok(app);
assert.equal(app.hello(),"hello");
# Test app
Demostrates an example node c++ app that depends on an external static library.
Because the external `mylib.a` library is statically built and linked it will be available inside the `app3.node` binary. See the `app4` example for how to handle
shared libraries.# Test app
Demostrates an example node c++ app that depends on an external library.

Sorry, the diff of this file is not supported yet

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