summaryrefslogtreecommitdiff
path: root/doc/api/n-api.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/n-api.md')
-rw-r--r--doc/api/n-api.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/doc/api/n-api.md b/doc/api/n-api.md
index a21d1f7ad7..4f27d8c552 100644
--- a/doc/api/n-api.md
+++ b/doc/api/n-api.md
@@ -42,6 +42,36 @@ for the N-API C based functions exported by Node.js. These wrappers are not
part of N-API, nor will they be maintained as part of Node.js. One such
example is: [node-addon-api](https://github.com/nodejs/node-addon-api).
+## Implications of ABI Stability
+
+Although N-API provides an ABI stability guarantee, other parts of Node.js do
+not, and any external libraries used from the addon may not. In particular,
+none of the following APIs provide an ABI stability guarantee across major
+versions:
+* the Node.js C++ APIs available via any of
+ ```C++
+ #include <node.h>
+ #include <node_buffer.h>
+ #include <node_version.h>
+ #include <node_object_wrap.h>
+ ```
+* the libuv APIs which are also included with Node.js and available via
+ ```C++
+ #include <uv.h>
+ ```
+* the V8 API available via
+ ```C++
+ #include <v8.h>
+ ```
+
+Thus, for an addon to remain ABI-compatible across Node.js major versions, it
+must make use exclusively of N-API by restricting itself to using
+```C
+#include <node_api.h>
+```
+and by checking, for all external libraries that it uses, that the external
+library makes ABI stability guarantees similar to N-API.
+
## Usage
In order to use the N-API functions, include the file