monkey patching
Changing how existing code behaves at run time by replacing its functions or properties from the outside.
In more detail
Old Node.js tools changed module loading by patching require.extensions, which is now deprecated. Module customization hooks give a supported way to do the same job.
Related terms
- module customization hooks — Functions you register with module.register() or module.registerHooks() to change how Node.js finds and loads modules.
- CommonJS — Node.js's original module system, which loads code with require() and exports it with module.exports.
Taught in
- Native Module Systems: ESM Loader Hooks vs CommonJS — Node.js Internals & Backend Services