Node.js · Senior · Question 50 of 75
What do module customization hooks (module.register, registerHooks) allow?
- 1Running modules on GPU
- 2Registering global variables for all modules
- ✓Correct answer: Changing how modules are resolved and loaded, e.g. to transpile files, mock modules in tests or load from custom sources
Explanation
Tools like tsx and test runners use them. They replace the old --loader approach and the hacks on require.extensions.