-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation for "path", "bytesRead", "bytesWritten" properties should also be in stream.html, not just fs.html #14448
Comments
Yes, that’s because non-fs streams don’t have that property (for example, sockets).
Yes, |
Okay, some confusion (here). We have a WriteStream and a WriteStream. The entries for both (read/write) streams on the "fs" page say
and
pointing to the stream page. So they are not, really. If I understand you correctly, they are based on ("extends") those streams but have the mentioned additional properties? I'm looking at their code now, but I'd say the documentation could be slightly more clear. I'm also just found that the documentation for After checking write-stream docs in both "fs" and "stream" and also the code a little bit I'm not sure how I should end a file write stream: Call the The example for a file write stream(!) actually is in "streams": So what is the |
No, the types are:
The documentation is correct. |
The documentation is confusing. Also, what I wrote - a bit more than half a sentence. I'll unsubscribe, I said what I had to say - the path forward does not look like it's going to be a fruitful and/or useful discussion. |
This issue asks to add members of filesystem streams to their parent types in the documentation. This is not the case in the implementation, therefore would be incorrect to do. The stream types in the In OOP, the I quite honestly do not see the confusion here. However, a link could help making this clearer. e.g: -- ReadStream is a Readable Stream
++ fs.ReadStream is a stream.Readable Possibly with links to make it easier to navigate. |
I don't think there's anything confusing here and no one has really volunteered to make this change in over 6 months. Closing but feel free to re-open if you're submitting a PR to change it. |
Relating to #4327 and #4368
I just searched and searched and had to resort to various tricky Google queries to find that the
path
property of stream(!) objects is not documented on the "stream" doc page - but on the "fs" page.https://nodejs.org/dist/latest-v8.x/docs/api/fs.html#fs_writestream_path
I think this belongs to https://nodejs.org/dist/latest-v8.x/docs/api/stream.html#stream_class_stream_writable and https://nodejs.org/dist/latest-v8.x/docs/api/stream.html#stream_class_stream_readable (too)
On that note, I find it highly confusing that there is a class
fs.WriteStream
(same for ReadStream) documented. Sure, it says "is a WriteStream", but combined with the fact that the documentation is DIFFERENT for the class on the two pages leads to the assumption that maybe it indeed is something different? I had to check the code inlib/fs.js
to make sure it really is the same class.So maybe there should be only one location for stream class documentation - and that should be under "streams"?
The text was updated successfully, but these errors were encountered: