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> 可以传入到initialize钩子的任意可克隆的 JavaScript 值。transferList<Object[]> 可转移对象 将传入initialize钩子。
注册一个模块,该模块导出 钩子,用于自定义 Node.js 模块的解析和加载行为。参见 自定义钩子。
🌐 Register a module that exports hooks that customize Node.js module resolution and loading behavior. See Customization hooks.