Expand description
Node module core module — require('module') (a.k.a. require('node:module')).
This is DISTINCT from src/module.rs (the CommonJS loader that actually reads
and runs files). This file is the user-facing module namespace: isBuiltin,
builtinModules, createRequire, Module.wrap, etc. The heavy lifting reuses
the loader’s own machinery — createRequire mints a real dir-bound require
closure through the same __cjs_require/__cjs_resolve global dispatch the
loader’s per-module require uses (see src/module.rs).
require('module').Module is the Module class namespace; its statics
(Module.isBuiltin, Module.wrap, Module.createRequire, Module.builtinModules)
delegate to the same implementations as the module-level exports (Node’s
Module.<x> === module.<x> for these).
Constants§
- METHODS
- Free functions exported by
require('module'). - MODULE_
STATIC_ METHODS - Static method names on the
Moduleclass (same surface as the module-level exports — Node aliases them).
Functions§
- call
- Module free-function dispatch (
module.isBuiltin,module.createRequire, …). - constant
- Non-function exports of
require('module'):builtinModules(array) and theModuleclass namespace. - static_
call Module.<method>static dispatch — same implementations as the module-level exports.- static_
constant - Non-function statics on the
Moduleclass:Module.builtinModulesand the self-referentialModule.Module(Node’sModule.Module === Module).