We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30461b4 commit cbfcd76Copy full SHA for cbfcd76
src/content/docs/plugin/file-system.mdx
@@ -256,7 +256,9 @@ Always call `file.close()` when you are done manipulating the file.
256
read: true,
257
baseDir: BaseDirectory.AppData,
258
});
259
- const buf = new Uint8Array();
+
260
+ const stat = await file.stat();
261
+ const buf = new Uint8Array(stat.size);
262
await file.read(buf);
263
const textContents = new TextDecoder().decode(buf);
264
await file.close();
0 commit comments