diff --git a/docs/fs-read-write.md b/docs/fs-read-write.md index ea9cf170..5e5f4207 100644 --- a/docs/fs-read-write.md +++ b/docs/fs-read-write.md @@ -18,7 +18,7 @@ fs.read(fd, buffer, offset, length, position) // Async/await usage: async function example () { - const { bytesRead, buffer } = await fs.read(fd, buffer, offset, length, position) + const { bytesRead, buffer } = await fs.read(fd, Buffer.alloc(length), offset, length, position) } ``` @@ -34,6 +34,6 @@ fs.write(fd, buffer, offset, length, position) // Async/await usage: async function example () { - const { bytesWritten, buffer } = await fs.write(fd, buffer, offset, length, position) + const { bytesWritten, buffer } = await fs.write(fd, Buffer.alloc(length), offset, length, position) } ```