Skip to content

Commit

Permalink
doc: mention N-API as recommended approach
Browse files Browse the repository at this point in the history
We've had a few comments that from the doc it might not
be clear that N-API is the recommended approach for Addons.
As a start, mention N-API early in the non N-API section
as the recommended approach unless lower level access
is required.

PR-URL: #28922
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
mhdawson authored and targos committed Aug 19, 2019
1 parent aff1ef9 commit edbe38d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ can be loaded into Node.js using the [`require()`][require] function, and used
just as if they were an ordinary Node.js module. They are used primarily to
provide an interface between JavaScript running in Node.js and C/C++ libraries.

At the moment, the method for implementing Addons is rather complicated,
There are three options for implementing Addons: N-API, nan, or direct
use of internal V8, libuv and Node.js libraries. Unless you need direct
access to functionality which is not exposed by N-API, use N-API.
Refer to the section [C/C++ Addons - N-API](n-api.html)
for more information on N-API.

When not using N-API, implementing Addons is complicated,
involving knowledge of several components and APIs:

- V8: the C++ library Node.js currently uses to provide the
Expand Down

0 comments on commit edbe38d

Please sign in to comment.