Skip to content

Commit

Permalink
Use built-in N-API on Node.js >= 6.14.2
Browse files Browse the repository at this point in the history
Update the version ranges in index.js to reflect that N-API is
now available in Node.js 6.x as of v6.14.2.

PR-URL: nodejs/node-addon-api#263
Reviewed-By: Hitesh Kanwathirtha <hiteshk@microsoft.com>
Reviewed-By: Kyle Farnung <kfarnung@microsoft.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
wroy7860 committed May 8, 2018
1 parent e0535f8 commit 962e95b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ var versionArray = process.version
// We know which version of Node.js first shipped the incarnation of the API
// available in *this* package. So, if we find that the Node.js version is below
// that, we indicate that the API is missing from Node.js.
var isNodeApiBuiltin =
(versionArray[0] > 8 || (versionArray[0] == 8 && versionArray[1] > 5));
var isNodeApiBuiltin = (
versionArray[0] > 8 ||
(versionArray[0] == 8 && versionArray[1] >= 6) ||
(versionArray[0] == 6 && versionArray[1] >= 14 && versionArray[2] >= 2));

// The flag is not needed when the Node version is not 8, nor if the API is
// built-in, because we removed the flag at the same time as creating the final
Expand Down

0 comments on commit 962e95b

Please sign in to comment.