module.register(specifier[, parentURL][, options])


稳定性: 1.1 - 处于活跃开发中

  • specifier <string> | <URL> 要注册的自定义钩子;这应该与传递给 import() 的字符串相同,除非它是相对路径,相对路径将相对于 parentURL 解析。
  • parentURL <string> | <URL> 如果你想要相对于一个基 URL(例如 import.meta.url)解析 specifier,你可以在这里传入该 URL。默认值: 'data:'
  • options <Object>

注册一个模块,该模块导出 钩子,用于自定义 Node.js 模块的解析和加载行为。参见 自定义钩子

🌐 Register a module that exports hooks that customize Node.js module resolution and loading behavior. See Customization hooks.