Skip to content

Commit

Permalink
doc: add docs for duplex.allowHalfOpen property
Browse files Browse the repository at this point in the history
PR-URL: #39126
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
pimterry authored and lpinca committed Aug 30, 2021
1 parent c67dc3e commit d14878d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/api/stream.md
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,21 @@ Examples of `Duplex` streams include:
* [zlib streams][zlib]
* [crypto streams][crypto]

##### `duplex.allowHalfOpen`
<!-- YAML
added: v0.9.4
-->

* {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`
<!-- YAML
added: v0.9.4
Expand Down

0 comments on commit d14878d

Please sign in to comment.