Skip to main content
ImportMeta.filename - Platform - Web documentation
property ImportMeta.filename
Private

The absolute path of the current module.

This property is only provided for local modules (ie. using file:// URLs).

Example:

// Unix
console.log(import.meta.filename); // /home/alice/my_module.ts

// Windows
console.log(import.meta.filename); // C:\alice\my_module.ts

Type

string