Bun Get the absolute path of the current file

Get the absolute path of the current file

jarle Updated

File contents

Get the absolute path of the current file

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

import.meta.path; // => "/a/b/c.ts"

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

jarle/bun-skills/tree/main/skills/bun-guides-util-import-meta-path commit 251a604e2d

Frequently asked questions

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