GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: link n-api module init to multi-load addons · nodejs/node@c44df51

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • n-api.md
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/n-api.md‎

Copy file name to clipboardExpand all lines: doc/api/n-api.md
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,10 @@ This macro includes `NAPI_MODULE`, and declares an `Init` function with a
11831183
special name and with visibility beyond the addon. This will allow Node.js to
11841184
initialize the module even if it is loaded multiple times.
11851185

1186+
There are a few design considerations when declaring a module that may be loaded
1187+
multiple times. The documentation of [context-aware addons][] provides more
1188+
details.
1189+
11861190
The variables `env` and `exports` will be available inside the function body
11871191
following the macro invocation.
11881192

@@ -4581,3 +4585,4 @@ This API may only be called from the main thread.
45814585
[`process.release`]: process.html#process_process_release
45824586
[`init` hooks]: async_hooks.html#async_hooks_init_asyncid_type_triggerasyncid_resource
45834587
[async_hooks `type`]: async_hooks.html#async_hooks_type
4588+
[context-aware addons]: addons.html#addons_context_aware_addons

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.