From d14878dc7c6d23038b59e837fcd61f8b35fced30 Mon Sep 17 00:00:00 2001 From: Tim Perry Date: Wed, 23 Jun 2021 16:20:08 +0200 Subject: 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(+) (limited to 'doc/api') diff --git a/doc/api/stream.md b/doc/api/stream.md index a7a8bedd924..13b1f2bef76 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -1651,6 +1651,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`