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 6669eff

Browse filesBrowse files
mhdawsonaddaleax
authored andcommitted
doc: clarify use of NAPI_EXPERIMENTAL
We've had a few questions about APIs not being available which were related to not having specified `NAPI_EXPERIMENTAL`. Add some additional documentation to explain this common issue: Refs: nodejs/node-addon-api#810 Signed-off-by: Michael Dawson <mdawson@devrus.com> PR-URL: #35195 Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent 89636e3 commit 6669eff
Copy full SHA for 6669eff

File tree

Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+12
-0
lines changed
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+12Lines changed: 12 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,18 @@ listed as supporting a later version.
257257

258258
\* Indicates that the N-API version was released as experimental
259259

260+
Each API documented for N-API will have a header named `added in:`, and APIs
261+
which are stable will have the additional header `N-API version:`.
262+
APIs are directly usable when using a Node.js version which supports
263+
the N-API version shown in `N-API version:` or higher.
264+
When using a Node.js version that does not support the
265+
`N-API version:` listed or if there is no `N-API version:` listed,
266+
then the API will only be available if
267+
`#define NAPI_EXPERIMENTAL` precedes the inclusion of `node_api.h`
268+
or `js_native_api.h`. If an API appears not to be available on
269+
a version of Node.js which is later than the one shown in `added in:` then
270+
this is most likely the reason for the apparent absence.
271+
260272
The N-APIs associated strictly with accessing ECMAScript features from native
261273
code can be found separately in `js_native_api.h` and `js_native_api_types.h`.
262274
The APIs defined in these headers are included in `node_api.h` and

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.