From ae9a4fffa64ff8499b61c9a41be445448204cf31 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Wed, 23 Jun 2021 16:20:08 +0200 Subject: [PATCH] doc: add docs for duplex.allowHalfOpen property --- doc/api/stream.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/stream.md b/doc/api/stream.md index 39dfbc8ab5c8bb..dfc69bebb3dfb4 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1593,6 +1593,21 @@ Examples of `Duplex` streams include: * [zlib streams][zlib] * [crypto streams][crypto] +##### `duplex.allowHalfOpen` + + +* {boolean} + +If `false` then the stream will automatically end the writable side when the +readable side ends. Set initially by the `allowHalfOpen` constructor option, +which defaults to `false`. + +This can be changed manually to change the half-open behavior of an existing +`Duplex` stream instance, but must be changed before the `'end'` event is +emitted. + #### Class: `stream.Transform`