Skip to main content

Get the absolute path of the current file

还没翻译译自英文(bun.com)本页 3 段都还没译

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 import.meta.

翻訳 © 2026 fanyi.dev · 原文 © 2026 the Bun project (LICENSE.md names no copyright holder) (MIT)