From ddf65fdca6582529c1dab854c6643e00dad08411 Mon Sep 17 00:00:00 2001 From: mert Date: Sat, 2 Sep 2023 10:54:24 +0300 Subject: [PATCH 1/6] doc: fix documentation for fs.createWriteStream highWaterMark option --- doc/api/fs.md | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index dddc179a4f6db7..6d5fda480c4a61 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2563,6 +2563,7 @@ changes: * `start` {integer} * `fs` {Object|null} **Default:** `null` * `signal` {AbortSignal|null} **Default:** `null` + * `highWaterMark` {number} **Default:** `16384` * Returns: {fs.WriteStream} `options` may also include a `start` option to allow writing data at some @@ -2580,20 +2581,6 @@ file descriptor leak. By default, the stream will emit a `'close'` event after it has been destroyed. Set the `emitClose` option to `false` to change this behavior. -By providing the `fs` option it is possible to override the corresponding `fs` -implementations for `open`, `write`, `writev`, and `close`. Overriding `write()` -without `writev()` can reduce performance as some optimizations (`_writev()`) -will be disabled. When providing the `fs` option, overrides for at least one of -`write` and `writev` are required. If no `fd` option is supplied, an override -for `open` is also required. If `autoClose` is `true`, an override for `close` -is also required. - -Like {fs.ReadStream}, if `fd` is specified, {fs.WriteStream} will ignore the -`path` argument and will use the specified file descriptor. This means that no -`'open'` event will be emitted. `fd` should be blocking; non-blocking `fd`s -should be passed to {net.Socket}. - -If `options` is a string, then it specifies the encoding. ### `fs.exists(path, callback)` From 1856128be6d6bf91cdbe5f949678dce42d00f01a Mon Sep 17 00:00:00 2001 From: mert Date: Sat, 2 Sep 2023 10:56:04 +0300 Subject: [PATCH 2/6] fix --- doc/api/fs.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index 6d5fda480c4a61..ca4002a657082d 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2581,6 +2581,18 @@ file descriptor leak. By default, the stream will emit a `'close'` event after it has been destroyed. Set the `emitClose` option to `false` to change this behavior. +By providing the `fs` option it is possible to override the corresponding `fs` +implementations for `open`, `write`, `writev`, and `close`. Overriding `write()` +without `writev()` can reduce performance as some optimizations (`_writev()`) +will be disabled. When providing the `fs` option, overrides for at least one of +`write` and `writev` are required. If no `fd` option is supplied, an override +for `open` is also required. If `autoClose` is `true`, an override for `close` +is also required. +Like {fs.ReadStream}, if `fd` is specified, {fs.WriteStream} will ignore the +`path` argument and will use the specified file descriptor. This means that no +`'open'` event will be emitted. `fd` should be blocking; non-blocking `fd`s +should be passed to {net.Socket}. +If `options` is a string, then it specifies the encoding. ### `fs.exists(path, callback)` From 7aff40275d09e4dd597222ad3bda6c4124f8bd6b Mon Sep 17 00:00:00 2001 From: mert Date: Sat, 2 Sep 2023 10:56:52 +0300 Subject: [PATCH 3/6] fix --- doc/api/fs.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index ca4002a657082d..ccc8de1ec3c173 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -2588,10 +2588,12 @@ will be disabled. When providing the `fs` option, overrides for at least one of `write` and `writev` are required. If no `fd` option is supplied, an override for `open` is also required. If `autoClose` is `true`, an override for `close` is also required. + Like {fs.ReadStream}, if `fd` is specified, {fs.WriteStream} will ignore the `path` argument and will use the specified file descriptor. This means that no `'open'` event will be emitted. `fd` should be blocking; non-blocking `fd`s should be passed to {net.Socket}. + If `options` is a string, then it specifies the encoding. ### `fs.exists(path, callback)` From 39fd2fc700be65eb2d925228296a93820178ed4e Mon Sep 17 00:00:00 2001 From: mert Date: Sun, 3 Sep 2023 19:44:10 +0300 Subject: [PATCH 4/6] added highWaterMark for fsPromises.opendir --- doc/api/fs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index ccc8de1ec3c173..95700651938296 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1258,6 +1258,7 @@ changes: performance but higher memory usage. **Default:** `32` * `recursive` {boolean} Resolved `Dir` will be an {AsyncIterable} containing all sub files and directories. **Default:** `false` + * `highWaterMark` {number} **Default:** `16384` * Returns: {Promise} Fulfills with an {fs.Dir}. Asynchronously open a directory for iterative scanning. See the POSIX From 9adbe1e181ec933bfa71e5c5b163d3cc123089cd Mon Sep 17 00:00:00 2001 From: mert Date: Sun, 3 Sep 2023 20:14:28 +0300 Subject: [PATCH 5/6] Revert "added highWaterMark for fsPromises.opendir" This reverts commit 39fd2fc700be65eb2d925228296a93820178ed4e. --- doc/api/fs.md | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index 95700651938296..ccc8de1ec3c173 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1258,7 +1258,6 @@ changes: performance but higher memory usage. **Default:** `32` * `recursive` {boolean} Resolved `Dir` will be an {AsyncIterable} containing all sub files and directories. **Default:** `false` - * `highWaterMark` {number} **Default:** `16384` * Returns: {Promise} Fulfills with an {fs.Dir}. Asynchronously open a directory for iterative scanning. See the POSIX From 328a05f2f90562bde71f4d7a65ee38abff019186 Mon Sep 17 00:00:00 2001 From: mert Date: Sun, 3 Sep 2023 20:17:15 +0300 Subject: [PATCH 6/6] added highWaterMark for filehandle.createWriteStream --- doc/api/fs.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/fs.md b/doc/api/fs.md index ccc8de1ec3c173..0035b950d6b53a 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -325,6 +325,7 @@ added: v16.11.0 * `autoClose` {boolean} **Default:** `true` * `emitClose` {boolean} **Default:** `true` * `start` {integer} + * `highWaterMark` {number} **Default:** `16384` * Returns: {fs.WriteStream} `options` may also include a `start` option to allow writing data at some