Module

js.node.Module (extern class)

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: https://nodejs.org/api/modules.html#modules_the_module_object

Static Members

builtinModules: 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: https://nodejs.org/api/modules.html#modules_module_builtinmodules

createRequire(filename: String): Function
See: https://nodejs.org/api/modules.html#modules_module_createrequire_filename
Name Type
filename String
Returns
Function

syncBuiltinESMExports(): 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: https://nodejs.org/api/modules.html#modules_module_syncbuiltinesmexports

Instance Members

children: Array<Module>

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

See: https://nodejs.org/api/modules.html#modules_module_children

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: https://nodejs.org/api/modules.html#modules_module_exports

filename: String

The fully resolved filename of the module.

See: https://nodejs.org/api/modules.html#modules_module_filename

The identifier for the module. Typically this is the fully resolved filename.

See: https://nodejs.org/api/modules.html#modules_module_id

loaded: Bool

Whether or not the module is done loading, or is in the process of loading.

See: https://nodejs.org/api/modules.html#modules_module_loaded

parent: Module

The module that first required this one.

See: https://nodejs.org/api/modules.html#modules_module_parent

paths: Array<String>

The search paths for the module.

See: https://nodejs.org/api/modules.html#modules_module_paths

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: https://nodejs.org/api/modules.html#modules_module_require_id
Name Type
id String
Returns
Dynamic

Metadata

Name Parameters
:jsRequire "module"