Build the native binding of a NodeJS library for multiple platforms/versions.
With no arguments, this script use the nearest node-gyp
installation to build binding.gyp
for the version of node
being used. Then it looks for binding.node
in the resulting build/Release
directory, and copies it into the vendor
directory (created on-the-fly). You will find it inside a subdirectory named ${process.platform}-${process.arch}-${moduleVersion}
.
When --target
or --version
are undefined, this script resolves their values for you.
NOTE: You must specify --version
if you specify --target
as a version not currently used by your shell.
After building the native binding, you can npm rm bindings
and use the provided binding.js
module for loading your native binding with require
. The binding.js
module is smart enough to know which vendor
subdirectory contains the appropriate binding for the current process.