napi-build-utils
A set of utilities to assist developers of tools that build N-API native add-ons.
The main repository can be found here.
-
napi-build-utils
-
.isNapiRuntime(runtime) ⇒
boolean
-
.isSupportedVersion(napiVersion) ⇒
boolean
- .logUnsupportedVersion(napiVersion, log)
-
.getBestNapiBuildVersion() ⇒
number
|undefined
-
.getNapiBuildVersions() ⇒
Array.<string>
-
.getNapiVersion() ⇒
string
|undefined
-
.isNapiRuntime(runtime) ⇒
boolean
napi-build-utils.isNapiRuntime(runtime) ⇒ Implements a consistent name of napi
for N-API runtimes.
Kind: static method of napi-build-utils
Param | Type | Description |
---|---|---|
runtime | string |
The runtime string. |
boolean
napi-build-utils.isSupportedVersion(napiVersion) ⇒ Determines whether the specified N-API version is supported by both the currently running Node instance and the package.
Kind: static method of napi-build-utils
Param | Type | Description |
---|---|---|
napiVersion | string |
The N-API version to check. |
napi-build-utils.logUnsupportedVersion(napiVersion, log)
Issues a warning to the supplied log if the N-API version is not supported by the current Node instance or if the N-API version is not supported by the package.
Kind: static method of napi-build-utils
Param | Type | Description |
---|---|---|
napiVersion | string |
The N-API version to check. |
log | Object |
The log object to which the warnings are to be issued. Must implement the warn method. |
number
| undefined
napi-build-utils.getBestNapiBuildVersion() ⇒ Returns the best N-API version to build given the highest N-API version supported by the current Node instance and the N-API versions supported by the package, or undefined if a suitable N-API version cannot be determined.
The best build version is the greatest N-API version supported by the package that is less than or equal to the highest N-API version supported by the current Node instance.
Kind: static method of napi-build-utils
Array.<string>
napi-build-utils.getNapiBuildVersions() ⇒ Returns an array of N-API versions supported by the package.
Kind: static method of napi-build-utils
string
| undefined
napi-build-utils.getNapiVersion() ⇒ Returns the highest N-API version supported by the current node instance or undefined if N-API is not supported.
Kind: static method of napi-build-utils