summaryrefslogtreecommitdiff
path: root/doc/api/addons.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/api/addons.md')
-rw-r--r--doc/api/addons.md3
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/addons.md b/doc/api/addons.md
index 59d708a71f..81bd8b5bac 100644
--- a/doc/api/addons.md
+++ b/doc/api/addons.md
@@ -143,6 +143,7 @@ followed by a function body.
The following three variables may be used inside the function body following an
invocation of `NODE_MODULE_INIT()`:
+
* `Local<Object> exports`,
* `Local<Value> module`, and
* `Local<Context> context`
@@ -158,6 +159,7 @@ they were created.
The context-aware addon can be structured to avoid global static data by
performing the following steps:
+
* defining a class which will hold per-addon-instance data. Such
a class should include a `v8::Persistent<v8::Object>` which will hold a weak
reference to the addon's `exports` object. The callback associated with the weak
@@ -259,6 +261,7 @@ signature.
In order to be loaded from multiple Node.js environments,
such as a main thread and a Worker thread, an add-on needs to either:
+
- Be an N-API addon, or
- Be declared as context-aware using `NODE_MODULE_INIT()` as described above