此代码片段将字符串写入磁盘上的特定_绝对路径_。 它使用高速的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.write() API 来高效地将数据写入磁盘。第一个参数是_目标路径_;第二个参数是要写入的_数据_。
任何相对路径都会相对于项目根目录(包含最近的
package.json 文件的目录)进行解析。
你可以传入一个
BunFile 作为目标。Bun.write() 会将数据写入其关联的路径。
Bun.write() 返回写入磁盘的字节数。
完整的
Bun.write() 文档请参见 文档 > API > 文件 I/O。