{"_id":"node-pre-gyp-qn","_rev":"10-c1329ec70d1ab22d586b727a82324a74","name":"node-pre-gyp-qn","description":"Node.js native addon binary install tool","dist-tags":{"latest":"0.6.5"},"versions":{"0.6.2":{"name":"node-pre-gyp-qn","description":"Node.js native addon binary install tool","version":"0.6.2","keywords":["native","addon","module","c","c++","bindings","binary"],"license":"BSD","author":{"name":"Dane Springmeyer","email":"dane@mapbox.com"},"repository":{"type":"git","url":"git://github.com/mapbox/node-pre-gyp.git"},"bin":{"node-pre-gyp-qn":"./bin/node-pre-gyp"},"main":"./lib/node-pre-gyp.js","dependencies":{"nopt":"~3.0.1","npmlog":"~0.1.1","request":"2.x","semver":"~4.2.0","tar":"~1.0.2","tar-pack":"~2.0.0","mkdirp":"~0.5.0","rc":"~0.5.1","rimraf":"~2.2.8"},"devDependencies":{"aws-sdk":"*","qn":"*","mocha":"1.x","retire":"0.3.x","jshint":"^2.5.10"},"jshintConfig":{"node":true,"globalstrict":true,"undef":true,"unused":true,"noarg":true,"mocha":true},"engineStrict":true,"engines":{"node":">= 0.8.0"},"scripts":{"prepublish":"retire -n","update-crosswalk":"node scripts/abi_crosswalk.js","test":"mocha -R spec --timeout 100000"},"gitHead":"c2ee7280442855ff5c0cc9e9ca70af37986a35cb","bugs":{"url":"https://github.com/mapbox/node-pre-gyp/issues"},"homepage":"https://github.com/mapbox/node-pre-gyp","bundleDependencies":["nopt","npmlog","request","semver","tar","tar-pack","mkdirp","rc","rimraf"],"_id":"node-pre-gyp-qn@0.6.2","_shasum":"19e5037a9cfd8d95664e6e28547bb6bef41c83cb","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"dist":{"shasum":"19e5037a9cfd8d95664e6e28547bb6bef41c83cb","tarball":"https://registry.npmjs.org/node-pre-gyp-qn/-/node-pre-gyp-qn-0.6.2.tgz","integrity":"sha512-diy/IfAVyDH73cTKAsw4RrjHLi4peFi/GHcTsi6BGx4fIi4B8zQYsi6Hzyp0vItg4lzCyMD5GIBUTAbvI/heCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4LUFvV3jM7F4aUvP1iioceVVH6XU2p+UkoTOtkyd0LAIhAOW96je1XleotLtZ9YQtO49bNsVYlC7fBl5UvWttwFdb"}]}},"0.6.3":{"name":"node-pre-gyp-qn","description":"Node.js native addon binary install tool","version":"0.6.3","keywords":["native","addon","module","c","c++","bindings","binary"],"license":"BSD","author":{"name":"Dane Springmeyer","email":"dane@mapbox.com"},"repository":{"type":"git","url":"git://github.com/mapbox/node-pre-gyp.git"},"bin":{"node-pre-gyp":"./bin/node-pre-gyp"},"main":"./lib/node-pre-gyp.js","dependencies":{"nopt":"~3.0.1","npmlog":"~0.1.1","request":"2.x","semver":"~4.2.0","tar":"~1.0.2","tar-pack":"~2.0.0","mkdirp":"~0.5.0","rc":"~0.5.1","rimraf":"~2.2.8"},"devDependencies":{"aws-sdk":"*","qn":"*","mocha":"1.x","retire":"0.3.x","jshint":"^2.5.10"},"jshintConfig":{"node":true,"globalstrict":true,"undef":true,"unused":true,"noarg":true,"mocha":true},"engineStrict":true,"engines":{"node":">= 0.8.0"},"scripts":{"update-crosswalk":"node scripts/abi_crosswalk.js","test":"mocha -R spec --timeout 100000"},"gitHead":"6dfa5b9ec2aa4783570baa0b936ac331069ef564","bugs":{"url":"https://github.com/mapbox/node-pre-gyp/issues"},"homepage":"https://github.com/mapbox/node-pre-gyp","bundleDependencies":["nopt","npmlog","request","semver","tar","tar-pack","mkdirp","rc","rimraf"],"_id":"node-pre-gyp-qn@0.6.3","_shasum":"0ccef85117627afadd71bcba5ad3f8dc838d1818","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"dist":{"shasum":"0ccef85117627afadd71bcba5ad3f8dc838d1818","tarball":"https://registry.npmjs.org/node-pre-gyp-qn/-/node-pre-gyp-qn-0.6.3.tgz","integrity":"sha512-xUgTYLnn9Jt5gA6ghnptz3+1grAsKYudPh1D3iA9v/TyNCpYlMbu6uS9FmplBjt6WNWQPhMF/AP6L85CuhU2rw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG1eTcCuCzG5okPLf3svx5aEII24rKU+rKrwp6nPlM3zAiAey6WnnEVmih04pxszQ0qj5LO2D+DvIBX+nAefeGuAww=="}]}},"0.6.4":{"name":"node-pre-gyp-qn","description":"Node.js native addon binary install tool","version":"0.6.4","keywords":["native","addon","module","c","c++","bindings","binary"],"license":"BSD","author":{"name":"Dane Springmeyer","email":"dane@mapbox.com"},"repository":{"type":"git","url":"git://github.com/mapbox/node-pre-gyp.git"},"bin":{"node-pre-gyp":"./bin/node-pre-gyp"},"main":"./lib/node-pre-gyp.js","dependencies":{"nopt":"~3.0.1","npmlog":"~0.1.1","request":"2.x","semver":"~4.2.0","tar":"~1.0.2","tar-pack":"~2.0.0","mkdirp":"~0.5.0","rc":"~0.5.1","rimraf":"~2.2.8"},"devDependencies":{"aws-sdk":"*","qn":"*","mocha":"1.x","retire":"0.3.x","jshint":"^2.5.10"},"jshintConfig":{"node":true,"globalstrict":true,"undef":true,"unused":true,"noarg":true,"mocha":true},"engineStrict":true,"engines":{"node":">= 0.8.0"},"scripts":{"update-crosswalk":"node scripts/abi_crosswalk.js","test":"mocha -R spec --timeout 100000"},"gitHead":"d7bb9d22c677a3330b566d548ca242c80a3ca5a5","bugs":{"url":"https://github.com/mapbox/node-pre-gyp/issues"},"homepage":"https://github.com/mapbox/node-pre-gyp","bundleDependencies":["nopt","npmlog","request","semver","tar","tar-pack","mkdirp","rc","rimraf"],"_id":"node-pre-gyp-qn@0.6.4","_shasum":"6b37e805c45ffa98a72f9ec323a5d59796d65b62","_from":".","_npmVersion":"2.4.1","_nodeVersion":"1.1.0","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"dist":{"shasum":"6b37e805c45ffa98a72f9ec323a5d59796d65b62","tarball":"https://registry.npmjs.org/node-pre-gyp-qn/-/node-pre-gyp-qn-0.6.4.tgz","integrity":"sha512-iFTo39ZhbLF9AZh5yekp+RFFtM6LDGd+fiNTVcmgqh7J9wsTO4KZq1tb2pXe5XSqrv16V8upsZqYeAY5D28Rcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH/eiDD/IkadbIITe2jDfrybYE9KKCZqRDbHPVQEzebQAiBrmDa8aXBqc5DMx4GEjOmG3ovqEux/WXKdpPTDwX3lew=="}]}},"0.6.5":{"name":"node-pre-gyp-qn","description":"Node.js native addon binary install tool","version":"0.6.5","keywords":["native","addon","module","c","c++","bindings","binary"],"license":"BSD","author":{"name":"Dane Springmeyer","email":"dane@mapbox.com"},"repository":{"type":"git","url":"git://github.com/mapbox/node-pre-gyp.git"},"bin":{"node-pre-gyp":"./bin/node-pre-gyp"},"main":"./lib/node-pre-gyp.js","dependencies":{"nopt":"~3.0.1","npmlog":"~1.1.0","request":"2.x","semver":"~4.3.0","tar":"~1.0.2","tar-pack":"~2.0.0","mkdirp":"~0.5.0","rc":"~0.6.0","rimraf":"~2.2.8"},"devDependencies":{"aws-sdk":"*","qn":"*","mocha":"1.x","retire":"0.3.x","jshint":"^2.5.10"},"jshintConfig":{"node":true,"globalstrict":true,"undef":true,"unused":true,"noarg":true,"mocha":true},"engineStrict":true,"engines":{"node":">= 0.8.0"},"scripts":{"update-crosswalk":"node scripts/abi_crosswalk.js","test":"jshint lib lib/util scripts bin/node-pre-gyp && mocha -R spec --timeout 500000"},"gitHead":"165e4fa8e76f62526e44965e1638e06cb374dab0","bugs":{"url":"https://github.com/mapbox/node-pre-gyp/issues"},"homepage":"https://github.com/mapbox/node-pre-gyp","bundleDependencies":["nopt","npmlog","request","semver","tar","tar-pack","mkdirp","rc","rimraf"],"_id":"node-pre-gyp-qn@0.6.5","_shasum":"f2d0966c1ee8ea4d92c48e778f02e7d76d453573","_from":".","_npmVersion":"2.5.1","_nodeVersion":"1.3.0","_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"dist":{"shasum":"f2d0966c1ee8ea4d92c48e778f02e7d76d453573","tarball":"https://registry.npmjs.org/node-pre-gyp-qn/-/node-pre-gyp-qn-0.6.5.tgz","integrity":"sha512-81O4cs5XMJ7MCLr+8j+NXtyYL/T8tYl/LagjRLc3eRQGd4fhENqS/L7Wr/ZO+J0LP8Mz1ZMnnrImXy7ZREp9LA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDkLZuYXjcI5EQZ0WbAVDjRsGOEd+fI7YkkxpBmtUi+VQIhAMGaIclpxr9b1gMfctjGf94VfPpPt0YiFQ7XQJ6gReFc"}]}}},"readme":"# node-pre-gyp\n\n#### node-pre-gyp makes it easy to publish and install Node.js C++ addons from binaries\n\n[![NPM](https://nodei.co/npm/node-pre-gyp.png?downloads=true&downloadRank=true)](https://nodei.co/npm/node-pre-gyp/)\n\n[![Build Status](https://api.travis-ci.org/mapbox/node-pre-gyp.svg)](https://travis-ci.org/mapbox/node-pre-gyp)\n[![Build status](https://ci.appveyor.com/api/projects/status/3nxewb425y83c0gv)](https://ci.appveyor.com/project/Mapbox/node-pre-gyp)\n[![Dependencies](https://david-dm.org/mapbox/node-pre-gyp.svg)](https://david-dm.org/mapbox/node-pre-gyp)\n\n`node-pre-gyp` stands between [npm](https://github.com/npm/npm) and [node-gyp](https://github.com/Tootallnate/node-gyp) and offers a cross-platform method of binary deployment.\n\n### Features\n\n - A command line tool called `node-pre-gyp` that can install your package's c++ module from a binary.\n - A variety of developer targeted commands for packaging, testing, and publishing binaries.\n - A Javascript module that can dynamically require your installed binary: `require('node-pre-gyp').find`\n\nFor a hello world example of a module packaged with `node-pre-gyp` see <https://github.com/springmeyer/node-addon-example> and [the wiki ](https://github.com/mapbox/node-pre-gyp/wiki/Modules-using-node-pre-gyp) for real world examples.\n\n## Credits\n\n - The module is modeled after [node-gyp](https://github.com/Tootallnate/node-gyp) by [@Tootallnate](https://github.com/Tootallnate)\n - Motivation for initial development came from [@ErisDS](https://github.com/ErisDS) and the [Ghost Project](https://github.com/TryGhost/Ghost).\n - Development is sponsored by [Mapbox](https://www.mapbox.com/)\n\n## FAQ\n\nSee the [Frequently Ask Questions](https://github.com/mapbox/node-pre-gyp/wiki/FAQ).\n\n## Depends\n\n - Node.js 0.12.x -> 0.8.x\n\n## Install\n\n`node-pre-gyp` is designed to be installed as a local dependency of your Node.js C++ addon and accessed like:\n\n    ./node_modules/.bin/node-pre-gyp --help\n\nBut you can also install it globally:\n\n    npm install node-pre-gyp -g\n\n## Usage\n\n### Commands\n\nView all possible commands:\n\n    node-pre-gyp --help\n\n- clean - Remove the entire folder containing the compiled .node module\n- install - Install pre-built binary for module\n- reinstall - Run \"clean\" and \"install\" at once\n- build - Compile the module by dispatching to node-gyp or nw-gyp\n- rebuild - Run \"clean\" and \"build\" at once\n- package - Pack binary into tarball\n- testpackage - Test that the staged package is valid\n- publish - Publish pre-built binary\n- unpublish - Unpublish pre-built binary\n- info - Fetch info on published binaries\n\nYou can also chain commands:\n\n    node-pre-gyp clean build unpublish publish info\n\n### Options\n\nOptions include:\n\n - `-C/--directory`: run the command in this directory\n - `--build-from-source`: build from source instead of using pre-built binary\n - `--runtime=node-webkit`: customize the runtime: `node` and `node-webkit` are the valid options\n - `--fallback-to-build`: fallback to building from source if pre-built binary is not available\n - `--target=0.10.25`: Pass the target node or node-webkit version to compile against\n - `--target_arch=ia32`: Pass the target arch and override the host `arch`. Valid values are 'ia32','x64', or `arm`.\n - `--target_platform=win32`: Pass the target platform and override the host `platform`. Valid values are `linux`, `darwin`, `win32`, `sunos`, `freebsd`, `openbsd`, and `aix`.\n\nBoth `--build-from-source` and `--fallback-to-build` can be passed alone or they can provide values. You can pass `--fallback-to-build=false` to override the option as declared in package.json. In addition to being able to pass `--build-from-source` you can also pass `--build-from-source=myapp` where `myapp` is the name of your module.\n\nFor example: `npm install --build-from-source=myapp`. This is useful if:\n\n - `myapp` is referenced in the package.json of a larger app and therefore `myapp` is being installed as a dependent with `npm install`.\n - The larger app also depends on other modules installed with `node-pre-gyp`\n - You only want to trigger a source compile for `myapp` and the other modules.\n\n### Configuring\n\nThis is a guide to configuring your module to use node-pre-gyp.\n\n#### 1) Add new entries to your `package.json`\n\n - Add `node-pre-gyp` to `bundledDependencies`\n - Add `aws-sdk` as a `devDependency`\n - Add a custom `install` script\n - Declare a `binary` object\n\nThis looks like:\n\n```js\n    \"dependencies\"  : {\n      \"node-pre-gyp\": \"0.5.x\"\n    },\n    \"bundledDependencies\":[\"node-pre-gyp\"],\n    \"devDependencies\": {\n      \"aws-sdk\": \"~2.0.0-rc.15\"\n    }\n    \"scripts\": {\n        \"install\": \"node-pre-gyp install --fallback-to-build\",\n    },\n    \"binary\": {\n        \"module_name\": \"your_module\",\n        \"module_path\": \"./lib/binding/\",\n        \"host\": \"https://your_module.s3-us-west-1.amazonaws.com\"\n    }\n```\n\nFor a full example see [node-addon-examples's package.json](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/package.json#L11-L22).\n\n##### The `binary` object has three required properties\n\n###### module_name\n\nThe name of your native node module. This value must:\n\n - Match the name passed to [the NODE_MODULE macro](http://nodejs.org/api/addons.html#addons_hello_world)\n - Must be a valid C variable name (e.g. it cannot contain `-`)\n - Should not include the `.node` extension.\n\n###### module_path\n\nThe location your native module is placed after a build. This should be an empty directory without other Javascript files. This entire directory will be packaged in the binary tarball. When installing from a remote package this directory will be overwritten with the contents of the tarball.\n\nNote: This property supports variables based on [Versioning](#versioning).\n\n###### host\n\nA url to the remote location where you've published tarball binaries (must be `https` not `http`).\n\nIt is highly recommended that you use Amazon S3. The reasons are:\n\n  - Various node-pre-gyp commands like `publish` and `info` only work with an S3 host.\n  - S3 is a very solid hosting platform for distributing large files, even [Github recommends using it instead of github](https://help.github.com/articles/distributing-large-binaries).\n  - We provide detail documentation for using [S3 hosting](#s3-hosting) with node-pre-gyp.\n\nWhy then not require S3? Because while some applications using node-pre-gyp need to distribute binaries as large as 20-30 MB, others might have very small binaries and might wish to store them in a github repo. This is not recommended, but if an author really wants to host in a non-s3 location then it should be possible.\n\n##### The `binary` object has two optional properties\n\n###### remote_path\n\nIt **is recommended** that you customize this property. This is an extra path to use for publishing and finding remote tarballs. The default value for `remote_path` is `\"\"` meaning that if you do not provide it then all packages will be published at the base of the `host`. It is recommended to provide a value like `./{name}/v{version}` to help organize remote packages in the case that you choose to publish multiple node addons to the same `host`.\n\nNote: This property supports variables based on [Versioning](#versioning).\n\n###### package_name\n\nIt is **not recommended** to override this property unless you are also overriding the `remote_path`. This is the versioned name of the remote tarball containing the binary `.node` module and any supporting files you've placed inside the `module_path` directory. Unless you specify `package_name` in your `package.json` then it defaults to `{module_name}-v{version}-{node_abi}-{platform}-{arch}.tar.gz` which allows your binary to work across node versions, platforms, and architectures. If you are using `remote_path` that is also versioned by `./{module_name}/v{version}` then you could remove these variables from the `package_name` and just use: `{node_abi}-{platform}-{arch}.tar.gz`. Then your remote tarball will be looked up at, for example, `https://example.com/your-module/v0.1.0/node-v11-linux-x64.tar.gz`.\n\nAvoiding the version of your module in the `package_name` and instead only embedding in a directory name can be useful when you want to make a quick tag of your module that does not change any C++ code. In this case you can just copy binaries to the new version behind the scenes like:\n\n```sh\naws s3 sync --acl public-read s3://mapbox-node-binary/sqlite3/v3.0.3/ s3://mapbox-node-binary/sqlite3/v3.0.4/\n```\n\nNote: This property supports variables based on [Versioning](#versioning).\n\n#### 2) Add a new target to binding.gyp\n\n`node-pre-gyp` calls out to `node-gyp` to compile the module and passes variables along like [module_name](#module_name) and [module_path](#module_path).\n\nA new target must be added to `binding.gyp` that moves the compiled `.node` module from `./build/Release/module_name.node` into the directory specified by `module_path`.\n\nAdd a target like this at the end of your `targets` list:\n\n```js\n    {\n      \"target_name\": \"action_after_build\",\n      \"type\": \"none\",\n      \"dependencies\": [ \"<(module_name)\" ],\n      \"copies\": [\n        {\n          \"files\": [ \"<(PRODUCT_DIR)/<(module_name).node\" ],\n          \"destination\": \"<(module_path)\"\n        }\n      ]\n    }\n```\n\nFor a full example see [node-addon-example's binding.gyp](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/binding.gyp).\n\n#### 3) Dynamically require your `.node`\n\nInside the main js file that requires your addon module you are likely currently doing:\n\n```js\nvar binding = require('../build/Release/binding.node');\n```\n\nor:\n\n```js\nvar bindings = require('./bindings')\n```\n\nChange those lines to:\n\n```js\nvar binary = require('node-pre-gyp');\nvar path = require('path');\nvar binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));\nvar binding = require(binding_path);\n```\n\nFor a full example see [node-addon-example's index.js](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/index.js#L1-L4)\n\n#### 4) Build and package your app\n\nNow build your module from source:\n\n    npm install --build-from-source\n\nThe `--build-from-source` tells `node-pre-gyp` to not look for a remote package and instead dispatch to node-gyp to build.\n\nNow `node-pre-gyp` should now also be installed as a local dependency so the command line tool it offers can be found at `./node_modules/.bin/node-pre-gyp`.\n\n#### 5) Test\n\nNow `npm test` should work just as it did before.\n\n#### 6) Publish the tarball\n\nThen package your app:\n\n    ./node_modules/.bin/node-pre-gyp package\n\nOnce packaged, now you can publish:\n\n    ./node_modules/.bin/node-pre-gyp publish\n\nCurrently the `publish` command pushes your binary to S3. This requires:\n\n - You have installed `aws-sdk` with `npm install aws-sdk`\n - You have created a bucket already.\n - The `host` points to an S3 http or https endpoint.\n - You have configured node-pre-gyp to read your S3 credentials (see [S3 hosting](#s3-hosting) for details).\n\nYou can also host your binaries elsewhere. To do this requires:\n\n - You manually publish the binary created by the `package` command to an `https` endpoint\n - Ensure that the `host` value points to your custom `https` endpoint.\n\n#### 7) Automate builds\n\nNow you need to publish builds for all the platforms and node versions you wish to support. This is best automated.\n\n - See [Appveyor Automation](#appveyor-automation) for how to auto-publish builds on Windows.\n - See [Travis Automation](#travis-automation) for how to auto-publish builds on OS X and Linux.\n\n#### 8) You're done!\n\nNow publish your module to the npm registry. Users will now be able to install your module from a binary. \n\nWhat will happen is this:\n\n1. `npm install <your package>` will pull from the npm registry\n2. npm will run the `install` script which will call out to `node-pre-gyp`\n3. `node-pre-gyp` will fetch the binary `.node` module and unpack in the right place\n4. Assuming that all worked, you are done\n\nIf a a binary was not available for a given platform and `--fallback-to-build` was used then `node-gyp rebuild` will be called to try to source compile the module.\n\n## S3 Hosting\n\nYou can host wherever you choose but S3 is cheap, `node-pre-gyp publish` expects it, and S3 can be integrated well with [travis.ci](http://travis-ci.org) to automate builds for OS X and Ubuntu. Here is an approach to do this:\n\nFirst, get setup locally and test the workflow:\n\n#### 1) Create an S3 bucket\n\nAnd have your **key** and **secret key** ready for writing to the bucket.\n\nIt is recommended to create a IAM user with a policy that only gives permissions to the specific bucket you plan to publish to. This can be done in the [IAM console](https://console.aws.amazon.com/iam/) by: 1) adding a new user, 2) choosing `Attach User Policy`, 3) Using the `Policy Generator`, 4) selecting `Amazon S3` for the service, 5) adding the actions: `DeleteObject`, `GetObject`, `GetObjectAcl`, `ListBucket`, `PutObject`, `PutObjectAcl`, 6) adding an ARN of `arn:aws:s3:::bucket/*` (replacing `bucket` with your bucket name), and finally 7) clicking `Add Statement` and saving the policy. It should generate a policy like:\n\n```js\n{\n  \"Version\": \"2012-10-17\",\n  \"Statement\": [\n    {\n      \"Sid\": \"Stmt1394587197000\",\n      \"Effect\": \"Allow\",\n      \"Action\": [\n        \"s3:DeleteObject\",\n        \"s3:GetObject\",\n        \"s3:GetObjectAcl\",\n        \"s3:ListBucket\",\n        \"s3:PutObject\",\n        \"s3:PutObjectAcl\"\n      ],\n      \"Resource\": [\n        \"arn:aws:s3:::node-pre-gyp-tests/*\"\n      ]\n    }\n  ]\n}\n```\n\n#### 2) Install node-pre-gyp\n\nEither install it globally:\n\n    npm install node-pre-gyp -g\n\nOr put the local version on your PATH\n\n    export PATH=`pwd`/node_modules/.bin/:$PATH\n\n#### 3) Configure AWS credentials\n\nThere are several ways to do this.\n\nYou can use any of the methods described at http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html.\n\nOr you can create a `~/.node_pre_gyprc`\n\nOr pass options in any way supported by [RC](https://github.com/dominictarr/rc#standards)\n\nA `~/.node_pre_gyprc` looks like:\n\n```js\n{\n    \"accessKeyId\": \"xxx\",\n    \"secretAccessKey\": \"xxx\"\n}\n```\n\nAnother way is to use your environment:\n\n    export node_pre_gyp_accessKeyId=xxx\n    export node_pre_gyp_secretAccessKey=xxx\n\nYou may also need to specify the `region` if it is not explicit in the `host` value you use. The `bucket` can also be specified but it is optional because `node-pre-gyp` will detect it from the `host` value.\n\n#### 4) Package and publish your build\n\nInstall the `aws-sdk`:\n\n    npm install aws-sdk\n\nThen publish:\n\n    node-pre-gyp package publish\n\nNote: if you hit an error like `Hostname/IP doesn't match certificate's altnames` it may mean that you need to provide the `region` option in your config.\n\n## Appveyor Automation\n\n[Appveyor](http://www.appveyor.com/) can build binaries and publish the results per commit and supports:\n\n - Windows Visual Studio 2013 and related compilers\n - Both 64 bit (x64) and 32 bit (x86) build configurations\n - Multiple Node.js versions\n\nFor an example of doing this see [node-sqlite3's appveyor.yml](https://github.com/mapbox/node-sqlite3/blob/master/appveyor.yml).\n\nBelow is a guide to getting set up:\n\n#### 1) Create a free Appveyor account\n\nGo to https://ci.appveyor.com/signup/free and sign in with your github account.\n\n#### 2) Create a new project\n\nGo to https://ci.appveyor.com/projects/new and select the github repo for your module\n\n#### 3) Add appveyor.yml and push it\n\nOnce you have committed an `appveyor.yml` ([appveyor.yml reference](http://www.appveyor.com/docs/appveyor-yml)) to your github repo and pushed it appveyor should automatically start building your project.\n\n#### 4) Create secure variables\n\nEncrypt your S3 AWS keys by going to <https://ci.appveyor.com/tools/encrypt> and hitting the `encrypt` button.\n\nThen paste the result into your `appveyor.yml`\n\n```yml\nenvironment:\n  node_pre_gyp_accessKeyId:\n    secure: Dn9HKdLNYvDgPdQOzRq/DqZ/MPhjknRHB1o+/lVU8MA=\n  node_pre_gyp_secretAccessKey:\n    secure: W1rwNoSnOku1r+28gnoufO8UA8iWADmL1LiiwH9IOkIVhDTNGdGPJqAlLjNqwLnL\n```\n\nNOTE: keys are per account but not per repo (this is difference than travis where keys are per repo but not related to the account used to encrypt them).\n\n#### 5) Hook up publishing\n\nJust put `node-pre-gyp package publish` in your `appveyor.yml` after `npm install`.\n\n#### 6) Publish when you want\n\nYou might wish to publish binaries only on a specific commit. To do this you could borrow from the [travis.ci idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:\n\n    SET CM=%APPVEYOR_REPO_COMMIT_MESSAGE%\n    if not \"%CM%\" == \"%CM:[publish binary]=%\" node-pre-gyp --msvs_version=2013 publish\n\nIf your commit message contains special characters (e.g. `&`) this method might fail. An alternative is to use PowerShell, which gives you additional possibilities, like ignoring case by using `ToLower()`:\n\n    ps: if($env:APPVEYOR_REPO_COMMIT_MESSAGE.ToLower().Contains('[publish binary]')) { node-pre-gyp --msvs_version=2013 publish }\n\nRemember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on travis see http://about.travis-ci.org/docs/user/deployment/npm/\n\n\n## Travis Automation\n\n[Travis](https://travis-ci.org/) can push to S3 after a successful build and supports both:\n\n - Ubuntu Precise and OS X (64 bit)\n - Multiple Node.js versions\n\nFor an example of doing this see [node-add-example's .travis.yml](https://github.com/springmeyer/node-addon-example/blob/2ff60a8ded7f042864ad21db00c3a5a06cf47075/.travis.yml).\n\nNote: if you need 32 bit binaries, this can be done from a 64 bit travis machine. See [the node-sqlite3 scripts for an example of doing this](https://github.com/mapbox/node-sqlite3/blob/bae122aa6a2b8a45f6b717fab24e207740e32b5d/scripts/build_against_node.sh#L54-L74).\n\nBelow is a guide to getting set up:\n\n#### 1) Install the travis gem\n\n    gem install travis\n\n#### 2) Create secure variables\n\nMake sure you run this command from within the directory of your module.\n\nUse `travis-encrypt` like:\n\n    travis encrypt node_pre_gyp_accessKeyId=${node_pre_gyp_accessKeyId}\n    travis encrypt node_pre_gyp_secretAccessKey=${node_pre_gyp_secretAccessKey}\n\nThen put those values in your `.travis.yml` like:\n\n```yaml\nenv:\n  global:\n    - secure: F+sEL/v56CzHqmCSSES4pEyC9NeQlkoR0Gs/ZuZxX1ytrj8SKtp3MKqBj7zhIclSdXBz4Ev966Da5ctmcTd410p0b240MV6BVOkLUtkjZJyErMBOkeb8n8yVfSoeMx8RiIhBmIvEn+rlQq+bSFis61/JkE9rxsjkGRZi14hHr4M=\n    - secure: o2nkUQIiABD139XS6L8pxq3XO5gch27hvm/gOdV+dzNKc/s2KomVPWcOyXNxtJGhtecAkABzaW8KHDDi5QL1kNEFx6BxFVMLO8rjFPsMVaBG9Ks6JiDQkkmrGNcnVdxI/6EKTLHTH5WLsz8+J7caDBzvKbEfTux5EamEhxIWgrI=\n```\n\nMore details on travis encryption at http://about.travis-ci.org/docs/user/encryption-keys/.\n\n#### 3) Hook up publishing\n\nJust put `node-pre-gyp package publish` in your `.travis.yml` after `npm install`.\n\n##### OS X publishing\n\nIf you want binaries for OS X in addition to linux you have two options:\n\n1) [Enabling multi-OS](#enabling-multi-os)\n\n2) [Using `language: objective-c` in a git branch](#using-language-objective-c).\n\n##### Enabling multi-OS\n\nThis requires emailing a request to `support@travis-ci.com` for each repo you wish to have enabled. More details at <http://docs.travis-ci.com/user/multi-os/>.\n\nNext you need to tweak the `.travis.yml` to ensure it is cross platform.\n\nUse a configuration like:\n\n```yml\n\nlanguage: cpp\n\nos:\n- linux\n- osx\n\nenv:\n  matrix:\n    - NODE_VERSION=\"0.10\"\n    - NODE_VERSION=\"0.11.14\"\n\nbefore_install:\n- rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm\n- source ~/.nvm/nvm.sh\n- nvm install $NODE_VERSION\n- nvm use $NODE_VERSION\n```\n\nSee [Travis OS X Gochas](#travis-os-x-gochas) for why we replace `language: node_js` and `node_js:` sections with `language: cpp` and a custom matrix.\n\n\nAlso create platform specific sections for any deps that need install. For example if you need libpng:\n\n```yml\n- if [ $(uname -s) == 'Linux' ]; then apt-get install libpng-dev; fi;\n- if [ $(uname -s) == 'Darwin' ]; then brew install libpng; fi;\n```\n\nFor detailed multi-OS examples see [node-mapnik](https://github.com/mapnik/node-mapnik/blob/master/.travis.yml) and [node-sqlite3](https://github.com/mapbox/node-sqlite3/blob/master/.travis.yml).\n\n##### Using `language: objective-c`\n\nIf your repo does not have multi-OS enabled, an alternative method for building for OS X is to tweak your `.travis.yml` to use:\n\n```yml\nlanguage: objective-c\n```\n\nKeep that change in a different git branch and sync that when you want binaries published.\n\nNext learn about a few [Travis OS X Gochas](#travis-os-x-gochas).\n\n##### Travis OS X Gochas\n\nFirst, unlike the Travis linux machines the OS X machines do not put `node-pre-gyp` on PATH by default. So to you will need to:\n\n```sh\nexport PATH=$(pwd)/node_modules/.bin:${PATH}\n```\n\nSecond, the OS X machines doe not support using a matrix for installing node.js different versions. So you need to bootstrap the installation of node.js in a cross platform way. \n\nBy doing:\n\n```yml\nenv:\n  matrix:\n    - NODE_VERSION=\"0.10\"\n    - NODE_VERSION=\"0.11.14\"\n\nbefore_install:\n - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm\n - source ~/.nvm/nvm.sh\n - nvm install $NODE_VERSION\n - nvm use $NODE_VERSION\n```\n\nYou can easily recreate the previous behavior of this matrix:\n\n```yml\nnode_js:\n  - \"0.10\"\n  - \"0.11.14\"\n```\n\n#### 4) Publish when you want\n\nYou might wish to publish binaries only on a specific commit. To do this you could borrow from the [travis.ci idea of commit keywords](http://about.travis-ci.org/docs/user/how-to-skip-a-build/) and add special handling for commit messages with `[publish binary]`:\n\n    COMMIT_MESSAGE=$(git show -s --format=%B $TRAVIS_COMMIT | tr -d '\\n')\n    if [[ ${COMMIT_MESSAGE} =~ \"[publish binary]\" ]]; then node-pre-gyp publish; fi;\n\nThen you can trigger new binaries to be built like:\n\n    git commit -a -m \"[publish binary]\"\n\nOr, if you don't have any changes to make simply run:\n\n    git commit --allow-empty -m \"[publish binary]\"\n\nRemember this publishing is not the same as `npm publish`. We're just talking about the binary module here and not your entire npm package. To automate the publishing of your entire package to npm on travis see http://about.travis-ci.org/docs/user/deployment/npm/\n\n# Versioning\n\nThe `binary` properties of `module_path`, `remote_path`, and `package_name` support variable substitution. The strings are evaluated by `node-pre-gyp` depending on your system and any custom build flags you passed.\n\n - `node_abi`: The node C++ `ABI` number. This value is available in Javascript as `process.versions.modules` as of [`>= v0.10.4 >= v0.11.7`](https://github.com/joyent/node/commit/ccabd4a6fa8a6eb79d29bc3bbe9fe2b6531c2d8e) and in C++ as the `NODE_MODULE_VERSION` define much earlier. For versions of Node before this was available we fallback to the V8 major and minor version.\n - `platform` matches node's `process.platform` like `linux`, `darwin`, and `win32` unless the user passed the `--target_platform` option to override.\n - `arch` matches node's `process.arch` like `x64` or `ia32` unless the user passes the `--target_arch` option to override.\n - `configuration` - Either 'Release' or 'Debug' depending on if `--debug` is passed during the build.\n - `module_name` - the `binary.module_name` attribute from `package.json`.\n - `version` - the semver `version` value for your module from `package.json` (NOTE: ignores the `semver.build` property).\n - `major`, `minor`, `patch`, and `prelease` match the individual semver values for your module's `version`\n - `build` - the sevmer `build` value. For example it would be `this.that` if your package.json `version` was `v1.0.0+this.that`\n - `prerelease` - the semver `prerelease` value. For example it would be `alpha.beta` if your package.json `version` was `v1.0.0-alpha.beta`\n\n\nThe options are visible in the code at <https://github.com/mapbox/node-pre-gyp/blob/612b7bca2604508d881e1187614870ba19a7f0c5/lib/util/versioning.js#L114-L127>\n","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"time":{"modified":"2022-06-21T18:16:06.356Z","created":"2015-02-04T09:21:48.127Z","0.6.2":"2015-02-04T09:21:48.127Z","0.6.3":"2015-02-04T09:56:58.461Z","0.6.4":"2015-02-09T14:35:15.460Z","0.6.5":"2015-02-20T12:22:17.769Z"},"homepage":"https://github.com/mapbox/node-pre-gyp","keywords":["native","addon","module","c","c++","bindings","binary"],"repository":{"type":"git","url":"git://github.com/mapbox/node-pre-gyp.git"},"author":{"name":"Dane Springmeyer","email":"dane@mapbox.com"},"bugs":{"url":"https://github.com/mapbox/node-pre-gyp/issues"},"license":"BSD","readmeFilename":"README.md"}