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
的資訊。
HTTP
程序
讀取檔案
執行時期
公用程式
WebSocket