Closed
Description
📗 API Reference Docs Problem
- Version: v16.2.0 (but applies to all)
- Platform: Linux 5.4.0-74-generic Improving code readability on lib/_http_agent.js #83-Ubuntu SMP x86_64 GNU/Linux
- Subsystem: streams
Location
Section of the site where the content exists
Affected URL(s):
Description
All duplex streams have an allowHalfOpen
property, which is publicly visible and writeable, with no documentation AFAICT but also no indication that it's intended as an internal-only API.
The constructor option is documented, but not the property on the stream instance itself.
I have two questions:
- Can I safely read this to check whether a given stream has allowHalfOpen enabled? I.e. is it a public API.
- Can I safely write to this? I.e. can I change that after the stream is constructed (before the other end ends its half of the stream of course).
As far as I can tell the answer to both is yes, but I'm hoping somebody can confirm that, and if so I think it would be useful to document these explicitly.
If one or neither is safe of course that's useful information! In that case maybe this should be underscored or similar to make it clear that it's an internal API.
- I would like to work on this issue and
submit a pull request.