From 4f9977ae0b7b865b91f1924b1cc1c961eefee034 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 8 Sep 2021 12:16:57 +0200 Subject: [PATCH] fs: simplify `create(Read|Write)Stream` doc --- doc/api/fs.md | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 9def0dec0c4376..81c1900db50986 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -242,9 +242,9 @@ added: REPLACEME * `start` {integer} * `end` {integer} **Default:** `Infinity` * `highWaterMark` {integer} **Default:** `64 * 1024` -* Returns: {fs.ReadStream} See [Readable Stream][]. +* Returns: {fs.ReadStream} -Unlike the 16 kb default `highWaterMark` for a readable stream, the stream +Unlike the 16 kb default `highWaterMark` for a {stream.Readable}, the stream returned by this method has a default `highWaterMark` of 64 kb. `options` can include `start` and `end` values to read a range of bytes from @@ -261,8 +261,7 @@ is available. This can prevent the process from exiting and the stream from closing naturally. By default, the stream will emit a `'close'` event after it has been -destroyed, like most `Readable` streams. Set the `emitClose` option to -`false` to change this behavior. +destroyed. Set the `emitClose` option to `false` to change this behavior. ```mjs import { open } from 'fs/promises'; @@ -307,7 +306,7 @@ added: REPLACEME * `autoClose` {boolean} **Default:** `true` * `emitClose` {boolean} **Default:** `true` * `start` {integer} -* Returns: {fs.WriteStream} See [Writable Stream][]. +* Returns: {fs.WriteStream} `options` may also include a `start` option to allow writing data at some position past the beginning of the file, allowed values are in the @@ -322,8 +321,7 @@ It is the application's responsibility to close it and make sure there's no file descriptor leak. By default, the stream will emit a `'close'` event after it has been -destroyed, like most `Writable` streams. Set the `emitClose` option to -`false` to change this behavior. +destroyed. Set the `emitClose` option to `false` to change this behavior. #### `filehandle.datasync()`