Documentation Index
Fetch the complete documentation index at: https://bun.zhcndoc.com/llms.txt
Use this file to discover all available pages before exploring further.
Bun.file() 函数接受一个路径并返回一个 BunFile 实例。BunFile 类继承自 Blob,允许你以多种格式延迟读取文件。使用 .arrayBuffer() 将文件读取为 ArrayBuffer。
ArrayBuffer 中的二进制内容随后可以作为类型化数组读取,例如 Int8Array。对于 Uint8Array,请使用.bytes()。
请参阅 类型化数组 文档以了解在 Bun 中使用类型化数组的更多信息。