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 <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • 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.