diff --git a/doc/api/module.md b/doc/api/module.md index 62780536914f96..1add32bc3ba4c9 100644 --- a/doc/api/module.md +++ b/doc/api/module.md @@ -220,6 +220,12 @@ changes: Register a module that exports [hooks][] that customize Node.js module resolution and loading behavior. See [Customization hooks][]. +This API is runtime-deprecated. New code should use +[`module.registerHooks()`][] instead, which runs hooks synchronously on the +main thread and avoids the worker-thread caveats listed under +[caveats of asynchronous customization hooks][]. Hook context fields are +kept in sync across both APIs to ease migration. + This feature requires `--allow-worker` if used with the [Permission Model][]. ### `module.registerHooks(options)` @@ -873,6 +879,11 @@ via `process.execArgv` inheritance. See [the documentation of `Worker`][] for de