module customization hooks

Functions you register with module.register() or module.registerHooks() to change how Node.js finds and loads modules.

In more detail

A resolve hook can rewrite where a specifier points, and a load hook can change a module's source before V8 compiles it, for example to transpile TypeScript or supply a mock. Hooks registered with module.register() run on a separate loader thread; the newer module.registerHooks() runs them synchronously on the main thread.

Related terms

Taught in

References