From 7fb8fe48755247a9cfd38b5f7a915cf71dca6561 Mon Sep 17 00:00:00 2001 From: Angelo Gazzola Date: Mon, 6 Oct 2025 11:11:55 +0200 Subject: [PATCH] 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 Reviewed-By: Akhil Marsonya Reviewed-By: Luigi Pinca --- doc/api/child_process.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/child_process.md b/doc/api/child_process.md index de45bf328d9..2d239240b32 100644 --- a/doc/api/child_process.md +++ b/doc/api/child_process.md @@ -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