Bun.file() 函式接受一個路徑並返回一個 BunFile 例項。使用 .exists() 方法來檢查給定路徑處的檔案是否存在。
const path = "/path/to/package.json";
const file = Bun.file(path);
await file.exists(); // boolean;
有關處理 BunFile 的更多資訊,請參閱 API > 檔案 I/O。
Bun.file() 函式接受一個路徑並返回一個 BunFile 例項。使用 .exists() 方法來檢查給定路徑處的檔案是否存在。
const path = "/path/to/package.json";
const file = Bun.file(path);
await file.exists(); // boolean;
有關處理 BunFile 的更多資訊,請參閱 API > 檔案 I/O。
HTTP
包管理器
將 bun install 與 Artifactory 一起使用
配置 Git 以 diff Bun 的 lockb lockfile
讀取檔案
執行時
流
將 ReadableStream 轉換為 Uint8Array
將 ReadableStream 轉換為 ArrayBuffer
將 Node.js Readable 轉換為 Uint8Array
實用程式