定制钩子


¥Customization Hooks

稳定性: 1.2 - 候选版本(异步版本)稳定性:1.1 - 主动开发(同步版本)

¥Stability: 1.2 - Release candidate (asynchronous version) Stability: 1.1 - Active development (synchronous version)

目前支持两种类型的模块自定义钩子:

¥There are two types of module customization hooks that are currently supported:

  1. module.register(specifier[, parentURL][, options]) 采用导出异步钩子函数的模块。这些函数在单独的加载器线程上运行。

    ¥module.register(specifier[, parentURL][, options]) which takes a module that exports asynchronous hook functions. The functions are run on a separate loader thread.

  2. module.registerHooks(options) 采用直接在加载模块的线程上运行的同步钩子函数。

    ¥module.registerHooks(options) which takes synchronous hook functions that are run directly on the thread where the module is loaded.