In each module, the module
free variable is a reference to the object representing the current module.
For convenience, module.exports
is also accessible via the exports
module-global.
module
is not actually a global but rather local to each module.
See also:
Static variables
staticread onlybuiltinModules:Array<String>
A list of the names of all modules provided by Node.js. Can be used to verify if a module is maintained by a third party or not.
See also:
Static methods
staticcreateRequire(filename:String):String ‑> Dynamic
staticcreateRequire(filename:URL):String ‑> Dynamic
staticsyncBuiltinESMExports():Void
The module.syncBuiltinESMExports()
method updates all the live bindings for builtin ES Modules to match the
properties of the CommonJS exports.
It does not add or remove exported names from the ES Modules.
See also:
Variables
exports:Dynamic
The module.exports
object is created by the Module system.
Sometimes this is not acceptable; many want their module to be an instance of some class.
To do this, assign the desired export object to module.exports
.
Assigning the desired object to exports
will simply rebind the local exports
variable, which is probably not
what is desired.
See also:
read onlyid:String
The identifier for the module. Typically this is the fully resolved filename.
See also:
read onlyloaded:Bool
Whether or not the module is done loading, or is in the process of loading.
See also: