diff --git a/doc/api/module.md b/doc/api/module.md index 23acde86771dc3..160007121e050a 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -115,6 +115,16 @@ changes: Register a module that exports [hooks][] that customize Node.js module resolution and loading behavior. See [Customization hooks][]. +All hooks, despite of where they were registered (main thread or worker thread), +are loaded and executed in a single shared thread that only serves hooks. Therefore any +side effect present will affect all threads that use the same hook. + +If global data must be stored in hooks, make sure to scope it using the `thread` +property that is present in the context of all customization hooks. + +All worker thread inherits the parent thread hooks chain when created. All subsequent modifications +in the parent or worker thread do not affect other chains. + ### `module.syncBuiltinESMExports()`