ImportMeta

external interface ImportMeta(source)

Properties

Link copied to clipboard
abstract external var dirname: String

The directory name of the current module.

Link copied to clipboard
abstract external var filename: String

The full absolute path and filename of the current module, with symlinks resolved.

Link copied to clipboard
abstract external var main: Boolean

true when the current module is the entry point of the current process; false otherwise.

Link copied to clipboard
abstract external var url: String

Functions

Link copied to clipboard
abstract external fun resolve(specifier: String): String
abstract external fun resolve(specifier: String, parent: String = definedExternally): String
abstract external fun resolve(specifier: String, parent: URL = definedExternally): String

import.meta.resolve is a module-relative resolution function scoped to each module, returning the URL string.