diff --git a/doc/api/stream.md b/doc/api/stream.md index 66023b0134fd04..8d575c25a38cdc 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1590,11 +1590,9 @@ async function run() { run().catch(console.error); ``` -On completion or error `stream.pipeline()` will call `stream.destroy(err)` on -all provided stream except for `Readable` streams which have emitted `'end'` -or `'close'` and `Writable` streams which have emitted `'finish'` or `'close'`. -Unless `autoDestroy` is enabled these streams will not be automatically cleaned -up. +`stream.pipeline()` will call `stream.destroy(err)` on all streams except: +- `Readable` streams which have emitted `'end'` or `'close'`. +- `Writable` streams which have emitted `'finish'` or `'close'`. `stream.pipeline()` leaves dangling event listeners on the streams after the `callback` has been invoked. In the case of reuse of streams after diff --git a/test.js b/test.js deleted file mode 100644 index 19064b70f028fd..00000000000000 --- a/test.js +++ /dev/null @@ -1,9 +0,0 @@ -const { Readable } = require('stream') - -const r = new Readable(); - -readable.on('readable', function() { - while (data = this.read()) { - console.log(data); - } -});