Require

external interface Require(source)

Properties

Link copied to clipboard
abstract external var cache: Dict<Module>

Modules are cached in this object when they are required. By deleting a key value from this object, the next require will reload the module. This does not apply to native addons, for which reloading will result in an error.

Link copied to clipboard
abstract external var extensions: RequireExtensions

Instruct require on how to handle certain file extensions.

Link copied to clipboard
abstract external var main: Module?

The Module object representing the entry script loaded when the Node.js process launched, or undefined if the entry point of the program is not a CommonJS module.

Link copied to clipboard
abstract external var resolve: RequireResolve

Functions

Link copied to clipboard
abstract operator external fun invoke(id: String): Any?

Used to import modules, JSON, and local files.