读取文件内容。
文件的路径。
包含文件内容的 ArrayBuffer 的异步操作结果。
const result = await readFile('/path/to/file.txt');if (result.isOk()) { const buffer = result.unwrap(); console.log(new TextDecoder().decode(buffer));} Copy
const result = await readFile('/path/to/file.txt');if (result.isOk()) { const buffer = result.unwrap(); console.log(new TextDecoder().decode(buffer));}
读取文件内容。