Skip to content

Commit 3e388cf

Browse files
mhdawsonMylesBorins
authored andcommittedApr 16, 2018
doc: Add initial documentation for N-API
Add the initial documentation for the N-API This PR is a result of work in the abi-stable-node repo: https://github.com/nodejs/abi-stable-node/tree/doc, with this PR being the cumulative work on the documentation sections in that repo with the following contributors in alphabetical order: Author: Arunesh Chandra <arunesh.chandra@microsoft.com> Author: Gabriel Schulhof <gabriel.schulhof@intel.com> Author: Hitesh Kanwathirtha <hiteshk@microsoft.com> Author: Jason Ginchereau <jasongin@microsoft.com> Author: Michael Dawson <michael_dawson@ca.ibm.com> Author: Sampson Gao <sampsong@ca.ibm.com> Author: Taylor Woll <taylor.woll@microsoft.com> Backport-PR-URL: #19447 PR-URL: #12549 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 49d74c6 commit 3e388cf

File tree

3 files changed

+3019
-0
lines changed

3 files changed

+3019
-0
lines changed
 

‎doc/api/_toc.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* [Assertion Testing](assert.html)
99
* [Buffer](buffer.html)
1010
* [C/C++ Addons](addons.html)
11+
* [C/C++ Addons - N-API](n-api.html)
1112
* [Child Processes](child_process.html)
1213
* [Cluster](cluster.html)
1314
* [Command Line Options](cli.html)

‎doc/api/addons.md

+20
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,26 @@ Addon developers are recommended to use to keep compatibility between past and
215215
future releases of V8 and Node.js. See the `nan` [examples][] for an
216216
illustration of how it can be used.
217217

218+
219+
## N-API
220+
221+
> Stability: 1 - Experimental
222+
223+
N-API is an API for building native Addons. It is independent from
224+
the underlying JavaScript runtime (ex V8) and is maintained as part of
225+
Node.js itself. This API will be Application Binary Interface (ABI) stable
226+
across version of Node.js. It is intended to insulate Addons from
227+
changes in the underlying JavaScript engine and allow modules
228+
compiled for one version to run on later versions of Node.js without
229+
recompilation. Addons are built/packaged with the same approach/tools
230+
outlined in this document (node-gyp, etc.). The only difference is the
231+
set of APIs that are used by the native code. Instead of using the V8
232+
or [Native Abstractions for Node.js][] APIs, the functions available
233+
in the N-API are used.
234+
235+
The functions available and how to use them are documented in the
236+
section titled [C/C++ Addons - N-API](n-api.html).
237+
218238
## Addon examples
219239

220240
Following are some example Addons intended to help developers get started. The

0 commit comments

Comments
 (0)