> ## Documentation Index
> Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 获取当前文件的绝对路径

Bun 在 [`import.meta`](/runtime/module-resolution#import-meta) 对象上提供了一些特定于模块的实用工具。使用 `import.meta.path` 来获取当前文件的绝对路径。

```ts /a/b/c.ts icon="https://mintcdn.com/bun-zhcndoc/cnUTwgMuf4cCrwC-/icons/typescript.svg?fit=max&auto=format&n=cnUTwgMuf4cCrwC-&q=85&s=e7767043c9e885c34f2d6c8fe2a95217" theme={"theme":{"light":"github-light","dark":"dracula"}}
import.meta.path; // => "/a/b/c.ts"
```

***

详见 [文档 > API > import.meta](/runtime/module-resolution#import-meta) 以获取完整文档。
