ImportMeta

sealed external interface ImportMeta(source)

Properties

Link copied to clipboard
abstract var dirname: String

The directory name of the current module.

Link copied to clipboard
abstract var filename: String

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

Link copied to clipboard
abstract var main: Boolean

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

Link copied to clipboard
abstract var url: String

The absolute file: URL of the module.

Functions

Link copied to clipboard
abstract fun resolve(specifier: String): String
abstract fun resolve(specifier: String, parent: ERROR CLASS: Symbol not found for URL = definedExternally): String
abstract fun resolve(specifier: String, parent: String = definedExternally): String

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