From 8ea4befc82c38482e4088b00f96950e3b3c6caf5 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 PR-URL: https://github.com/nodejs/node/pull/39126 Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- doc/api/stream.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/api/stream.md b/doc/api/stream.md index 21abb6e20bff10..c4c31e116e1aee 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1652,6 +1652,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`