Skip to content

Commit edbe38d

Browse files
mhdawsontargos
authored andcommitted
doc: mention N-API as recommended approach
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]>
1 parent aff1ef9 commit edbe38d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/api/addons.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ can be loaded into Node.js using the [`require()`][require] function, and used
88
just as if they were an ordinary Node.js module. They are used primarily to
99
provide an interface between JavaScript running in Node.js and C/C++ libraries.
1010

11-
At the moment, the method for implementing Addons is rather complicated,
11+
There are three options for implementing Addons: N-API, nan, or direct
12+
use of internal V8, libuv and Node.js libraries. Unless you need direct
13+
access to functionality which is not exposed by N-API, use N-API.
14+
Refer to the section [C/C++ Addons - N-API](n-api.html)
15+
for more information on N-API.
16+
17+
When not using N-API, implementing Addons is complicated,
1218
involving knowledge of several components and APIs:
1319

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

0 commit comments

Comments
 (0)