Module

external class Module(source)

Constructors

Link copied to clipboard
constructor(id: String, parent: Module = definedExternally)

Properties

Link copied to clipboard

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

Link copied to clipboard
external var exports: Any?

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.

Link copied to clipboard
external var filename: String

The fully resolved filename of the module.

Link copied to clipboard
external var id: String

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

Link copied to clipboard
external var isPreloading: Boolean

true if the module is running during the Node.js preload phase.

Link copied to clipboard
external var loaded: Boolean

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

Link copied to clipboard
external var path: String

The directory name of the module. This is usually the same as the path.dirname() of the module.id.

Link copied to clipboard
external var paths: ReadonlyArray<String>

The search paths for the module.

Functions

Link copied to clipboard
external fun require(id: String): Any?

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