@@ -277,8 +277,8 @@ added: v0.9.4
277277The ` 'error' ` event is emitted if an error occurred while writing or piping
278278data. The listener callback is passed a single ` Error ` argument when called.
279279
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
282282stream.
283283
284284After ` 'error' ` , no further events other than ` 'close' ` * should* be emitted
@@ -1667,11 +1667,7 @@ const { Writable } = require('stream');
16671667
16681668class MyWritable extends Writable {
16691669 constructor ({ highWaterMark, ... options }) {
1670- super ({
1671- highWaterMark,
1672- autoDestroy: true ,
1673- emitClose: true
1674- });
1670+ super ({ highWaterMark });
16751671 // ...
16761672 }
16771673}
@@ -1745,6 +1741,9 @@ changes:
17451741 pr-url: https://github.com/nodejs/node/pull/22795
17461742 description: Add `autoDestroy` option to automatically `destroy()` the
17471743 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`.
17481747-->
17491748
17501749* ` options ` {Object}
@@ -1776,7 +1775,7 @@ changes:
17761775 * ` final ` {Function} Implementation for the
17771776 [ ` stream._final() ` ] [ stream-_final ] method.
17781777 * ` autoDestroy ` {boolean} Whether this stream should automatically call
1779- ` .destroy() ` on itself after ending. ** Default:** ` false ` .
1778+ ` .destroy() ` on itself after ending. ** Default:** ` true ` .
17801779
17811780<!-- eslint-disable no-useless-constructor -->
17821781``` js
@@ -2021,6 +2020,9 @@ changes:
20212020 pr-url: https://github.com/nodejs/node/pull/22795
20222021 description: Add `autoDestroy` option to automatically `destroy()` the
20232022 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`.
20242026-->
20252027
20262028* ` options ` {Object}
@@ -2039,7 +2041,7 @@ changes:
20392041 * ` destroy ` {Function} Implementation for the
20402042 [ ` stream._destroy() ` ] [ readable-_destroy ] method.
20412043 * ` autoDestroy ` {boolean} Whether this stream should automatically call
2042- ` .destroy() ` on itself after ending. ** Default:** ` false ` .
2044+ ` .destroy() ` on itself after ending. ** Default:** ` true ` .
20432045
20442046<!-- eslint-disable no-useless-constructor -->
20452047``` js
0 commit comments