Skip to content

Commit d548f4d

Browse files
kevinoidTrott
authored andcommitted
doc: update emitClose default for fs streams
The default for the `emitClose` option was changed from `false` to `true` by #31408 which landed in f0d2df4 for v14.0.0. This commit updates the fs doc to match the current behavior. Signed-off-by: Kevin Locke <kevin@kevinlocke.name> PR-URL: #36653 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>
1 parent 1b68030 commit d548f4d

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

doc/api/fs.md

+14-8
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,9 @@ changes:
17651765
- v15.4.0
17661766
pr-url: https://github.com/nodejs/node/pull/35922
17671767
description: The `fd` option accepts FileHandle arguments.
1768+
- version: v14.0.0
1769+
pr-url: https://github.com/nodejs/node/pull/31408
1770+
description: Change `emitClose` default to `true`.
17681771
- version:
17691772
- v13.6.0
17701773
- v12.17.0
@@ -1799,7 +1802,7 @@ changes:
17991802
* `fd` {integer|FileHandle} **Default:** `null`
18001803
* `mode` {integer} **Default:** `0o666`
18011804
* `autoClose` {boolean} **Default:** `true`
1802-
* `emitClose` {boolean} **Default:** `false`
1805+
* `emitClose` {boolean} **Default:** `true`
18031806
* `start` {integer}
18041807
* `end` {integer} **Default:** `Infinity`
18051808
* `highWaterMark` {integer} **Default:** `64 * 1024`
@@ -1827,9 +1830,9 @@ If `fd` points to a character device that only supports blocking reads
18271830
available. This can prevent the process from exiting and the stream from
18281831
closing naturally.
18291832

1830-
By default, the stream will not emit a `'close'` event after it has been
1831-
destroyed. This is the opposite of the default for other `Readable` streams.
1832-
Set the `emitClose` option to `true` to change this behavior.
1833+
By default, the stream will emit a `'close'` event after it has been
1834+
destroyed, like most `Readable` streams. Set the `emitClose` option to
1835+
`false` to change this behavior.
18331836

18341837
By providing the `fs` option, it is possible to override the corresponding `fs`
18351838
implementations for `open`, `read`, and `close`. When providing the `fs` option,
@@ -1876,6 +1879,9 @@ changes:
18761879
- v15.4.0
18771880
pr-url: https://github.com/nodejs/node/pull/35922
18781881
description: The `fd` option accepts FileHandle arguments.
1882+
- version: v14.0.0
1883+
pr-url: https://github.com/nodejs/node/pull/31408
1884+
description: Change `emitClose` default to `true`.
18791885
- version:
18801886
- v13.6.0
18811887
- v12.17.0
@@ -1908,7 +1914,7 @@ changes:
19081914
* `fd` {integer|FileHandle} **Default:** `null`
19091915
* `mode` {integer} **Default:** `0o666`
19101916
* `autoClose` {boolean} **Default:** `true`
1911-
* `emitClose` {boolean} **Default:** `false`
1917+
* `emitClose` {boolean} **Default:** `true`
19121918
* `start` {integer}
19131919
* `fs` {Object|null} **Default:** `null`
19141920
* Returns: {fs.WriteStream} See [Writable Stream][].
@@ -1925,9 +1931,9 @@ then the file descriptor won't be closed, even if there's an error.
19251931
It is the application's responsibility to close it and make sure there's no
19261932
file descriptor leak.
19271933

1928-
By default, the stream will not emit a `'close'` event after it has been
1929-
destroyed. This is the opposite of the default for other `Writable` streams.
1930-
Set the `emitClose` option to `true` to change this behavior.
1934+
By default, the stream will emit a `'close'` event after it has been
1935+
destroyed, like most `Writable` streams. Set the `emitClose` option to
1936+
`false` to change this behavior.
19311937

19321938
By providing the `fs` option it is possible to override the corresponding `fs`
19331939
implementations for `open`, `write`, `writev` and `close`. Overriding `write()`

0 commit comments

Comments
 (0)