執行環境套件管理器打包器測試執行器程式碼檢查格式化指南參考部落格意見回饋

獲取當前檔案的檔名

Bun 在 import.meta 物件上提供了一些模組特定的實用工具。使用 import.meta.file 可以獲取當前檔案的檔名。

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

參見 import.meta。