Bun

指南工具

使用 Bun 取得目前檔案的檔案名稱

Bun 在 import.meta 物件上提供了一些模組特定的工具。使用 import.meta.file 來檢索目前檔案的名稱。

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

請參閱 文件 > API > import.meta 以取得完整文件。