Skip to content

Commit d3dc124

Browse files
kevinoiddanielleadams
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 <[email protected]> PR-URL: #36653 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Robert Nagy <[email protected]>
1 parent 181bd05 commit d3dc124

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
@@ -1755,6 +1755,9 @@ changes:
17551755
- v15.4.0
17561756
pr-url: https://github.com/nodejs/node/pull/35922
17571757
description: The `fd` option accepts FileHandle arguments.
1758+
- version: v14.0.0
1759+
pr-url: https://github.com/nodejs/node/pull/31408
1760+
description: Change `emitClose` default to `true`.
17581761
- version:
17591762
- v13.6.0
17601763
- v12.17.0
@@ -1789,7 +1792,7 @@ changes:
17891792
* `fd` {integer|FileHandle} **Default:** `null`
17901793
* `mode` {integer} **Default:** `0o666`
17911794
* `autoClose` {boolean} **Default:** `true`
1792-
* `emitClose` {boolean} **Default:** `false`
1795+
* `emitClose` {boolean} **Default:** `true`
17931796
* `start` {integer}
17941797
* `end` {integer} **Default:** `Infinity`
17951798
* `highWaterMark` {integer} **Default:** `64 * 1024`
@@ -1817,9 +1820,9 @@ If `fd` points to a character device that only supports blocking reads
18171820
available. This can prevent the process from exiting and the stream from
18181821
closing naturally.
18191822

1820-
By default, the stream will not emit a `'close'` event after it has been
1821-
destroyed. This is the opposite of the default for other `Readable` streams.
1822-
Set the `emitClose` option to `true` to change this behavior.
1823+
By default, the stream will emit a `'close'` event after it has been
1824+
destroyed, like most `Readable` streams. Set the `emitClose` option to
1825+
`false` to change this behavior.
18231826

18241827
By providing the `fs` option, it is possible to override the corresponding `fs`
18251828
implementations for `open`, `read`, and `close`. When providing the `fs` option,
@@ -1866,6 +1869,9 @@ changes:
18661869
- v15.4.0
18671870
pr-url: https://github.com/nodejs/node/pull/35922
18681871
description: The `fd` option accepts FileHandle arguments.
1872+
- version: v14.0.0
1873+
pr-url: https://github.com/nodejs/node/pull/31408
1874+
description: Change `emitClose` default to `true`.
18691875
- version:
18701876
- v13.6.0
18711877
- v12.17.0
@@ -1898,7 +1904,7 @@ changes:
18981904
* `fd` {integer|FileHandle} **Default:** `null`
18991905
* `mode` {integer} **Default:** `0o666`
19001906
* `autoClose` {boolean} **Default:** `true`
1901-
* `emitClose` {boolean} **Default:** `false`
1907+
* `emitClose` {boolean} **Default:** `true`
19021908
* `start` {integer}
19031909
* `fs` {Object|null} **Default:** `null`
19041910
* Returns: {fs.WriteStream} See [Writable Stream][].
@@ -1915,9 +1921,9 @@ then the file descriptor won't be closed, even if there's an error.
19151921
It is the application's responsibility to close it and make sure there's no
19161922
file descriptor leak.
19171923

1918-
By default, the stream will not emit a `'close'` event after it has been
1919-
destroyed. This is the opposite of the default for other `Writable` streams.
1920-
Set the `emitClose` option to `true` to change this behavior.
1924+
By default, the stream will emit a `'close'` event after it has been
1925+
destroyed, like most `Writable` streams. Set the `emitClose` option to
1926+
`false` to change this behavior.
19211927

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

0 commit comments

Comments
 (0)