ImportMeta

sealed external interface ImportMeta(source)

Properties

Link copied to clipboard
abstract var dirname: String

The directory name of the current module. This is the same as the path.dirname() of the import.meta.filename. Caveat: only present on file: modules.

Link copied to clipboard
abstract var filename: String

The full absolute path and filename of the current module, with symlinks resolved. This is the same as the url.fileURLToPath() of the import.meta.url. Caveat: only local modules support this property. Modules not using the file: protocol will not provide it.

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: unknown class>? = definedExternally): String
abstract fun resolve(specifier: String, parent: String? = definedExternally): String

Provides a module-relative resolution function scoped to each module, returning the URL string.