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
实用程序