> ## 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.file` 可以获取当前文件的文件名。

```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.file; // => "c.ts"
```

***

完整文档请参见 [文档 > API > import.meta](/runtime/module-resolution#import-meta)。
