@@ -277,8 +277,8 @@ added: v0.9.4
277
277
The ` 'error' ` event is emitted if an error occurred while writing or piping
278
278
data. The listener callback is passed a single ` Error ` argument when called.
279
279
280
- The stream is not closed when the ` 'error' ` event is emitted unless the
281
- [ ` autoDestroy ` ] [ writable-new ] option was set to ` true ` when creating the
280
+ The stream is closed when the ` 'error' ` event is emitted unless the
281
+ [ ` autoDestroy ` ] [ writable-new ] option was set to ` false ` when creating the
282
282
stream.
283
283
284
284
After ` 'error' ` , no further events other than ` 'close' ` * should* be emitted
@@ -1667,11 +1667,7 @@ const { Writable } = require('stream');
1667
1667
1668
1668
class MyWritable extends Writable {
1669
1669
constructor ({ highWaterMark, ... options }) {
1670
- super ({
1671
- highWaterMark,
1672
- autoDestroy: true ,
1673
- emitClose: true
1674
- });
1670
+ super ({ highWaterMark });
1675
1671
// ...
1676
1672
}
1677
1673
}
@@ -1745,6 +1741,9 @@ changes:
1745
1741
pr-url: https://github.com/nodejs/node/pull/22795
1746
1742
description: Add `autoDestroy` option to automatically `destroy()` the
1747
1743
stream when it emits `'finish'` or errors.
1744
+ - version: REPLACEME
1745
+ pr-url: https://github.com/nodejs/node/pull/30623
1746
+ description: Change `autoDestroy` option default to `true`.
1748
1747
-->
1749
1748
1750
1749
* ` options ` {Object}
@@ -1776,7 +1775,7 @@ changes:
1776
1775
* ` final ` {Function} Implementation for the
1777
1776
[ ` stream._final() ` ] [ stream-_final ] method.
1778
1777
* ` autoDestroy ` {boolean} Whether this stream should automatically call
1779
- ` .destroy() ` on itself after ending. ** Default:** ` false ` .
1778
+ ` .destroy() ` on itself after ending. ** Default:** ` true ` .
1780
1779
1781
1780
<!-- eslint-disable no-useless-constructor -->
1782
1781
``` js
@@ -2021,6 +2020,9 @@ changes:
2021
2020
pr-url: https://github.com/nodejs/node/pull/22795
2022
2021
description: Add `autoDestroy` option to automatically `destroy()` the
2023
2022
stream when it emits `'end'` or errors.
2023
+ - version: REPLACEME
2024
+ pr-url: https://github.com/nodejs/node/pull/30623
2025
+ description: Change `autoDestroy` option default to `true`.
2024
2026
-->
2025
2027
2026
2028
* ` options ` {Object}
@@ -2039,7 +2041,7 @@ changes:
2039
2041
* ` destroy ` {Function} Implementation for the
2040
2042
[ ` stream._destroy() ` ] [ readable-_destroy ] method.
2041
2043
* ` autoDestroy ` {boolean} Whether this stream should automatically call
2042
- ` .destroy() ` on itself after ending. ** Default:** ` false ` .
2044
+ ` .destroy() ` on itself after ending. ** Default:** ` true ` .
2043
2045
2044
2046
<!-- eslint-disable no-useless-constructor -->
2045
2047
``` js
0 commit comments