Bun.file()
函數接受路徑並回傳 BunFile
實例。使用 .exists()
方法來檢查在給定路徑上檔案是否存在。
const path = "/path/to/package.json";
const file = Bun.file(path);
await file.exists(); // boolean;
請參閱 API > 檔案 I/O 以取得更多關於使用 BunFile
的資訊。
Bun.file()
函數接受路徑並回傳 BunFile
實例。使用 .exists()
方法來檢查在給定路徑上檔案是否存在。
const path = "/path/to/package.json";
const file = Bun.file(path);
await file.exists(); // boolean;
請參閱 API > 檔案 I/O 以取得更多關於使用 BunFile
的資訊。
套件管理器
設定 git 以 diff Bun 的 lockb lockfile
在 GitHub Actions 中使用 Bun 安裝依賴項
讀取檔案
執行階段
串流
將 ReadableStream 轉換為 Uint8Array
將 ReadableStream 轉換為 ArrayBuffer
將 Node.js Readable 轉換為 Uint8Array
工具程式