You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For ESM, there's currently no way for Node.js to hook into the evaluation of child modules, will need to discuss with V8 about it (issue). Allowing mutation of the exports would require a spec change so out of scope for module.registerHooks() or Node.js in general
Reordering of the documentation when module.registerHooks() is battle tested enough and should be preferred over module.register to avoid various caveats module.registerHooks() tracking issue #56241
Implement evaluation hook for at least CJS to help use cases like require-in-the-middle, which was supposed to be based on doc: add synchronous hooks proposal loaders#198 but we had some discussions over the collaboration summit/NodeConf EU about changing the hook to be "wrapping around evaluation", not "after evaluation": WIP
Nice to have:
Advocating it to popular npm packages doing CJS monkey-patching to reduce the overall dependency of CJS loader internals in the ecosystem
node:builtin?param=val& figure out how to make search params work with CJS cacheSymbol.disposeintegration (requested in implement module.registerHooks() to run synchronous module customization hooks in thread #55698 (comment))so thatwe can't really polyfillmodule.register()can be an helper built on top ofmodule.registerHooks(), and internally we only have one set of hooking points to take care ofmodule.registerwith it if we want to keep the internals to ourselves, oh wellmodule.register()quirk during interop: module: handle null source from async loader hooks in sync hooks #59929module.registerHooks()or Node.js in generalmodule.registerHooks()is battle tested enough and should be preferred overmodule.registerto avoid various caveats module.registerHooks() tracking issue #56241Moved to #62720
vmmodule primitives & loader API for ESM customization #62720startGraphhook proposed in Proposal: Moving hooks on thread loaders#205Nice to have:
module.register()built on top ofmodule.registerHooks(): WIP in https://github.com/joyeecheung/module-register-ponyfill