Bun Get the file name of the current file

Get the file name of the current file

jarle Updated

File contents

Get the file name of the current file

Bun provides a handful of module-specific utilities on the import.meta object. Use import.meta.file to retrieve the name of the current file.

import.meta.file; // => "c.ts"

See Docs > API > import.meta for complete documentation.

jarle/bun-skills/tree/main/skills/bun-guides-util-import-meta-file commit a6414f49b2

Frequently asked questions

npx skillmds@latest add jarle/bun-get-the-file-name-of-the-current-file