Language concepts
import.meta
A module meta-property exposing host-defined metadata. Its available properties vary by runtime; it is not available in classic scripts. Multi-file example: save each listed file separately, then run the entry file with Node.js. See the packaged fixture for the original files.
Formal Syntax & Structure
javascript syntaxjavascript
import.metaWorking Example
Example Snippetjavascript
// File: main.mjsconst url = new URL("./data.json", import.meta.url);console.log(import.meta.url.endsWith("/main.mjs"), url.pathname.endsWith("/data.json"));