Skip to content

Commit

Permalink
doc: add tip for NODE_MODULE
Browse files Browse the repository at this point in the history
  • Loading branch information
theanarkh committed Dec 10, 2022
1 parent d579bc1 commit 66862e7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions doc/api/addons.md
Expand Up @@ -107,6 +107,14 @@ When building addons with `node-gyp`, using the macro `NODE_GYP_MODULE_NAME` as
the first parameter of `NODE_MODULE()` will ensure that the name of the final
binary will be passed to `NODE_MODULE()`.

If you define addon with `NODE_MODULE`, The usage is as follows.

1. If you load the addon in main thread first, you can not load the addon
in worker.
2. If you load the addon in worker first, you can not load the addon in
main thread or other workers until the worker which have loaded the addon
exits.

### Context-aware addons

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

0 comments on commit 66862e7

Please sign in to comment.