Bun

指南实用程序

使用 Bun 获取当前文件的目录

Bun 在 import.meta 对象上提供了许多特定于模块的实用程序。

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

有关完整的文档,请参阅 文档 > API > import.meta