-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
doc: stdout, stderr and stdin are all Duplex streams #11194
doc: stdout, stderr and stdin are all Duplex streams #11194
Conversation
I'm not convinced that we should document these as |
Just for clarification, that I don’t think it’s Node’s place to enforce these convention when the OS doesn’t. |
True, but it's also not that practically useful unless there's an obscure use case I'm missing. |
Maybe we could start printing warnings to fd The docs are still technically correct due to the weirdness that is the stdio impl. I think changing it to note that it is |
That would be certainly more useful |
Just because it may not be used very often doesn't mean its not useful. Why should we have an opinion on this, particularly if its platform independent, and pre-existing? There are interesting use-cases, like |
Agree with #11194 (comment), we should doc its actual class. |
30d6058
to
5a00980
Compare
I've amended changes to the commit so the actual class is now documented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some suggestions, I find the "from/to" confusing, but basically LGTM.
doc/api/process.md
Outdated
associated with `stderr` (fd `2`). | ||
The `process.stderr` property returns a stream equivalent to or | ||
associated with `stderr` (fd `2`). It is a `net.Socket` (inherits from `stream.Duplex`) | ||
unless it is from/to a file, in which case it is a [Writable][] stream. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest: "unless fd 2
refers to a file, "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sam-github Thank you for reviewing. I made the requested changes and rebased with master. I had some merge conflicts on the same sections in the docs.
Can you review again? Thanks!
doc/api/process.md
Outdated
The `process.stderr` property returns a [Writable][] stream equivalent to or | ||
associated with `stderr` (fd `2`). | ||
The `process.stderr` property returns a stream equivalent to or | ||
associated with `stderr` (fd `2`). It is a `net.Socket` (inherits from `stream.Duplex`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"(which inherits"
b78f255
to
a7b5e61
Compare
code looks good, @Fishrock123 assigned this to himself, so he'll need a chance to review you should shorten your commit message, guidelines are here: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md#step-3-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there, small nit
doc/api/process.md
Outdated
`stderr` (fd `2`). | ||
The `process.stderr` property returns a stream connected to | ||
`stderr` (fd `2`). It is a `net.Socket` (which inherits from | ||
`stream.Duplex`) unless fd `2` refers to a file, in which case it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be worthwhile to have this (and the other reference below) be a link to the Duplex
doc
a7b5e61
to
d5793b7
Compare
@jasnell: I made the changes, can you review again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with one small comment
doc/api/process.md
Outdated
The `process.stderr` property returns a [Writable][] stream connected to | ||
`stderr` (fd `2`). | ||
The `process.stderr` property returns a stream connected to | ||
`stderr` (fd `2`). It is a `net.Socket` (which is a [Duplex][] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you link net.Socket
to it's definition in net.md
? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Fishrock123 done
d5793b7
to
a2f9c82
Compare
@seppevs sorry this took so long, by now |
…n states otherwise This is a fix for nodejs#9201
a2f9c82
to
b3a6a25
Compare
@fhinkel done! |
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes #9201 PR-URL: #11194 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Looks like she forgot to close it. Please re-open if this was in error. |
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes #9201 PR-URL: #11194 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes #9201 PR-URL: #11194 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
backported to v6.x-staging. If it should be backed out lmk |
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes #9201 PR-URL: #11194 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
stdout, stderr and stdin are all Duplex streams but documentation states otherwise Fixes nodejs/node#9201 PR-URL: nodejs/node#11194 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
doc: stdout, stderr and stdin are all Duplex streams but documentation states otherwise
This is a fix for #9201
Checklist
Affected core subsystem(s)
doc