module.register(specifier[, parentURL][, options])
稳定性: 1.1 - 处于活跃开发中
specifier<string> | <URL> 要注册的自定义钩子;这应该与传递给import()的字符串相同,除非它是相对路径,相对路径将相对于parentURL解析。parentURL<string> | <URL> 如果你想要相对于一个基 URL(例如import.meta.url)解析specifier,你可以在这里传入该 URL。默认值:'data:'options<Object>data<any> 任何可任意克隆的 JavaScript 值,用于传入initialize钩子。transferList<Object[]> 可转移对象 将传入initialize钩子。
注册一个模块,该模块导出 钩子,用于自定义 Node.js 模块的解析和加载行为。参见 自定义钩子。
🌐 Register a module that exports hooks that customize Node.js module resolution and loading behavior. See Customization hooks.