import.meta

An object available inside an ES module that describes the module itself; import.meta.url is the file:// URL of the current file.

In more detail

It replaces CommonJS's __filename and __dirname. Recent Node.js versions also offer import.meta.filename and import.meta.dirname directly.

Related terms

Taught in

References