doc: fix typo on child_process.md

This note on `options.stdio` mentions that it's not recommended to pass
`stdin` as a writable stream and `stdout/stderr` as readable, but then
proceeds to say to always check that `stdin` is writable and
`stdout/stderr` are readable.

Going by the examples and the fact that `process.stdin` is readable and
`process.stdout/process.stderr` are writable, I'm assuming that the
types in the recommendation got swapped.

PR-URL: https://github.com/nodejs/node/pull/60114
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Akhil Marsonya <akhil.marsonya27@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Angelo Gazzola 2025-10-06 11:11:55 +02:00 committed by Michaël Zasso
parent 1b25008b41
commit 7fb8fe4875
No known key found for this signature in database
GPG Key ID: 770F7A9A5AE15600

View File

@ -1078,8 +1078,8 @@ pipes between the parent and child. The value is one of the following:
them incorrectly (e.g., passing a readable stream where a writable stream is
expected) can lead to unexpected results or errors. This practice is discouraged
as it may result in undefined behavior or dropped callbacks if the stream
encounters errors. Always ensure that `stdin` is used as writable and
`stdout`/`stderr` as readable to maintain the intended flow of data between
encounters errors. Always ensure that `stdin` is used as readable and
`stdout`/`stderr` as writable to maintain the intended flow of data between
the parent and child processes.
7. Positive integer: The integer value is interpreted as a file descriptor
that is open in the parent process. It is shared with the child