node-pre-gyp
Advanced tools
Comparing version 0.1.4 to 0.1.5
@@ -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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
56
17
5
22358
10
579