summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorMathias Buus <mathiasbuus@gmail.com>2018-08-21 20:05:12 +0200
committerMathias Buus <mathiasbuus@gmail.com>2018-10-30 15:17:40 +0100
commitf24b070cb7fb04df6249fab5264df2146e2b6cac (patch)
tree46438985fb9676a4e5b951a00f8a30693f25c280 /doc
parentcd1193d9ed83c37a431a19ae33bbf5e25ec15d65 (diff)
downloadandroid-node-v8-f24b070cb7fb04df6249fab5264df2146e2b6cac.tar.gz
android-node-v8-f24b070cb7fb04df6249fab5264df2146e2b6cac.tar.bz2
android-node-v8-f24b070cb7fb04df6249fab5264df2146e2b6cac.zip
stream: add auto-destroy mode
PR-URL: https://github.com/nodejs/node/pull/22795 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/stream.md17
1 files changed, 17 insertions, 0 deletions
diff --git a/doc/api/stream.md b/doc/api/stream.md
index fb2f2da28d..f2e1c2a0c4 100644
--- a/doc/api/stream.md
+++ b/doc/api/stream.md
@@ -1493,6 +1493,11 @@ changes:
pr-url: https://github.com/nodejs/node/pull/18438
description: >
Add `emitClose` option to specify if `'close'` is emitted on destroy
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/22795
+ description: >
+ Add `autoDestroy` option to automatically `destroy()` the stream
+ when it emits `'finish'` or errors
-->
* `options` {Object}
@@ -1521,6 +1526,8 @@ changes:
[`stream._destroy()`][writable-_destroy] method.
* `final` {Function} Implementation for the
[`stream._final()`][stream-_final] method.
+ * `autoDestroy` {boolean} Whether this stream should automatically call
+ `.destroy()` on itself after ending. **Default:** `false`.
```js
const { Writable } = require('stream');
@@ -1756,6 +1763,14 @@ Custom `Readable` streams *must* call the `new stream.Readable([options])`
constructor and implement the `readable._read()` method.
#### new stream.Readable([options])
+<!-- YAML
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/22795
+ description: >
+ Add `autoDestroy` option to automatically `destroy()` the stream
+ when it emits `'end'` or errors
+-->
* `options` {Object}
* `highWaterMark` {number} The maximum [number of bytes][hwm-gotcha] to store
@@ -1770,6 +1785,8 @@ constructor and implement the `readable._read()` method.
method.
* `destroy` {Function} Implementation for the
[`stream._destroy()`][readable-_destroy] method.
+ * `autoDestroy` {boolean} Whether this stream should automatically call
+ `.destroy()` on itself after ending. **Default:** `false`.
```js
const { Readable } = require('stream');