@@ -1504,6 +1504,9 @@ fs.copyFileSync('source.txt', 'destination.txt', COPYFILE_EXCL);
1504
1504
<!-- YAML
1505
1505
added: v0.1.31
1506
1506
changes:
1507
+ - version: REPLACEME
1508
+ pr-url: https://github.com/nodejs/node/pull/29212
1509
+ description: Enable `emitClose` option.
1507
1510
- version: v11.0.0
1508
1511
pr-url: https://github.com/nodejs/node/pull/19898
1509
1512
description: Impose new restrictions on `start` and `end`, throwing
@@ -1529,6 +1532,7 @@ changes:
1529
1532
* ` fd ` {integer} ** Default:** ` null `
1530
1533
* ` mode ` {integer} ** Default:** ` 0o666 `
1531
1534
* ` autoClose ` {boolean} ** Default:** ` true `
1535
+ * ` emitClose ` {boolean} ** Default:** ` false `
1532
1536
* ` start ` {integer}
1533
1537
* ` end ` {integer} ** Default:** ` Infinity `
1534
1538
* ` highWaterMark ` {integer} ** Default:** ` 64 * 1024 `
@@ -1555,6 +1559,10 @@ If `fd` points to a character device that only supports blocking reads
1555
1559
available. This can prevent the process from exiting and the stream from
1556
1560
closing naturally.
1557
1561
1562
+ By default, the stream will not emit a ` 'close' ` event after it has been
1563
+ destroyed. This is the opposite of the default for other ` Readable ` streams.
1564
+ Set the ` emitClose ` option to ` true ` to change this behavior.
1565
+
1558
1566
``` js
1559
1567
const fs = require (' fs' );
1560
1568
// Create a stream from some character device.
@@ -1592,6 +1600,9 @@ If `options` is a string, then it specifies the encoding.
1592
1600
<!-- YAML
1593
1601
added: v0.1.31
1594
1602
changes:
1603
+ - version: REPLACEME
1604
+ pr-url: https://github.com/nodejs/node/pull/29212
1605
+ description: Enable `emitClose` option.
1595
1606
- version: v7.6.0
1596
1607
pr-url: https://github.com/nodejs/node/pull/10739
1597
1608
description: The `path` parameter can be a WHATWG `URL` object using
@@ -1615,6 +1626,7 @@ changes:
1615
1626
* ` fd ` {integer} ** Default:** ` null `
1616
1627
* ` mode ` {integer} ** Default:** ` 0o666 `
1617
1628
* ` autoClose ` {boolean} ** Default:** ` true `
1629
+ * ` emitClose ` {boolean} ** Default:** ` false `
1618
1630
* ` start ` {integer}
1619
1631
* Returns: {fs.WriteStream} See [ Writable Stream] [ ] .
1620
1632
@@ -1631,6 +1643,10 @@ then the file descriptor won't be closed, even if there's an error.
1631
1643
It is the application's responsibility to close it and make sure there's no
1632
1644
file descriptor leak.
1633
1645
1646
+ By default, the stream will not emit a ` 'close' ` event after it has been
1647
+ destroyed. This is the opposite of the default for other ` Writable ` streams.
1648
+ Set the ` emitClose ` option to ` true ` to change this behavior.
1649
+
1634
1650
Like [ ` ReadStream ` ] [ ] , if ` fd ` is specified, [ ` WriteStream ` ] [ ] will ignore the
1635
1651
` path ` argument and will use the specified file descriptor. This means that no
1636
1652
` 'open' ` event will be emitted. ` fd ` should be blocking; non-blocking ` fd ` s
0 commit comments