Skip to content

Commit 5623814

Browse files
committed
doc: add tip for NODE_MODULE
1 parent d579bc1 commit 5623814

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/api/addons.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,14 @@ When building addons with `node-gyp`, using the macro `NODE_GYP_MODULE_NAME` as
107107
the first parameter of `NODE_MODULE()` will ensure that the name of the final
108108
binary will be passed to `NODE_MODULE()`.
109109

110+
If you define addon with `NODE_MODULE`, The usage is as follows.
111+
112+
1. If you load the addon in main thread first, you can not load the addon
113+
in worker.
114+
2. If you load the addon in worker first, you can not load the addon in
115+
main thread, and you can only load the addon in another worker after the
116+
worker which have loaded the addon exsits.
117+
110118
### Context-aware addons
111119

112120
There are environments in which Node.js addons may need to be loaded multiple

0 commit comments

Comments
 (0)