ImportMeta.filename - Web documentation
property ImportMeta.filename

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