Bun

指南工具

使用 Bun 將檔案 URL 轉換為絕對路徑

使用 Bun.fileURLToPath()file:// URL 轉換為絕對路徑。

Bun.fileURLToPath("file:///path/to/file.txt");
// => "/path/to/file.txt"

請參閱文件 > API > 工具以了解更多實用工具。