Bun

指南實用程式

使用 Bun 獲取當前檔案的目錄

Bun 在 import.meta 物件上提供了許多特定於模組的實用程式。

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

有關完整的文件,請參閱 文件 > API > import.meta