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.4 to 0.1.5

8

lib/publish.js

@@ -37,7 +37,6 @@

if (err) return callback(err);
//compile.run_gyp(['rebuild'],function(err) {
compile.run_gyp(['rebuild'],opts,function(err,opts) {
if (err) return callback(err);
var staging = path.join('stage',opts.versioned);
var filter_func = function (entry) {
//console.log(entry);
var filter_func = function (entry) {
return entry.type == 'Directory' || path.extname(entry.basename) == '.node';

@@ -53,6 +52,5 @@ }

})
console.log(opts.versioned);
//})
})
return callback();
});
}

@@ -17,3 +17,3 @@

module.exports.run_gyp = function(args,callback) {
module.exports.run_gyp = function(args,opts,callback) {
var shell_cmd = 'node-gyp';

@@ -28,3 +28,3 @@ if (win) {

}
callback();
callback(null,opts);
});

@@ -35,4 +35,4 @@ cmd.on('close', function (err, stdout, stderr) {

}
callback();
callback(null,opts);
});
}
{
"name": "node-pre-gyp",
"description": "Node.js native addon binary install tool",
"version": "0.1.4",
"version": "0.1.5",
"keywords": [

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

# node-pre-gyp
Node.js native addon binary install tool.
Node.js native add-on binary install tool.
Stands in front of node-gyp, installs your module from a pre-compiled binary,
and avoids node-gyp (and its dependencies) needing to be invoked or even installed.
- Stands in front of node-gyp
- Installs your module from a pre-compiled binary (which you are responsible for hosting)
- If successfull avoids needing node-gyp to be invoked.
- Falls back to calling `node-gyp rebuild` if binaries are not available
EXPERIMENTAL - not ready for widespread use.
# Design
You add a `binary` property to your `package.json` which lists:
- `module_name`: The name of your native node module.
- `module_path`: The location your native module is placed after a build (commonly `build/Release/`)
- `remote_uri`: A url to the remote location where tarball binaries are available
- `template`: A versioning string which describes the tarball versioning scheme for your binaries
And example from `node-osmium` looks like:
```js
"binary": {
"module_name": "osmium",
"module_path": "./lib",
"remote_uri": "http://node-osmium.s3.amazonaws.com",
"template": "{module_name}-v{major}.{minor}.{patch}-{node_abi}-{platform}-{arch}.tar.gz"
},
```
Then to package a binary you do:
```js
mkdir stage
node-pre-gyp publish
```
Then post the resulting tarball (in the `stage/` directory) to your remote location.
Finally you add a custom `install` script:
```js
"scripts": {
"install": "node-pre-gyp rebuild",
}
```
Then users installing your module will get your binary, if available, instead of a source compile.
# Modules using `node-pre-gyp`:
- [node-osmium](https://github.com/osmcode/node-osmium)
- [node-sqlite3](https://github.com/mapbox/node-sqlite3)
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