Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request implements a number of improvements to the node-pre-gyp N-API support for issue #402.
N-API builds for only those N-API versions supported by the Node instance
node-pre-gyp now verifies the N-API build versions being requested and builds only those versions supported by current Node instance. If no version can be built, an error message is generated.
New
--build-latest-napi-version-only
build argumentA new
--build-latest-napi-version-only
build argument instructs node-pre-gyp to build only the highest N-API version supported by the Node instance. This is useful in CI and test environments where only the most current N-API build is needed.Support for NAN and N-API builds from the same project
This PR introduces the ability to build both N-API and NAN binaries from the same package.
Placing the configuration value
{node_napi_label}
in the package.jsonbinary.package_name
property instructs node-pre-gyp to build all viable N-API binaries supported by the current Node instance. If the current Node instance does not support N-API, node-pre-gyp will request a traditional, non-N-API build.The configuration value
{node_napi_label}
is set by node-pre-gyp to the type of build created. For N-API builds, the string contains the N-API version with values likenapi-v3
. For traditional, non-N-API builds, the string contains the ABI version with values likenode-v46
.The C/C++ symbol
NAPI_VERSION
can be used to distinguish N-API and non-N-API builds.There are more details in the updated main
README.md
file.Build support for Node 4
This PR fixes a JavaScript language issue that was preventing builds against some versions of Node 4.
Better recovery from build errors
A
configure
is no longer required in the case where abuild
fails.NAPI_VERSION
replacesNAPI_BUILD_VERSION
Previously, the documentation recommended defining the C/C++ symbol
NAPI_BUILD_VERSION
. The documentation now recommends the symbolNAPI_VERSION
which is used by the N-API C/C++ headers to define the API for that specific N-API version.