Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit edbe38d

Browse filesBrowse 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 <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>
1 parent aff1ef9 commit edbe38d
Copy full SHA for edbe38d

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/addons.md‎

Copy file name to clipboardExpand all lines: doc/api/addons.md
+7-1Lines changed: 7 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.