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

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

read onlychildren:Array<Module>

The module objects required for the first time by this one.

See also:

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 onlyfilename:String

The fully resolved filename of the module.

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:

read onlyparent:Module

The module that first required this one.

See also:

read onlypaths:Array<String>

The search paths for the module.

See also:

Methods

require(id:String):Dynamic

The module.require() method provides a way to load a module as if require() was called from the original module.

See also: