From 1d734a75b5764ac7414daab489ce82d6ca09f69f Mon Sep 17 00:00:00 2001 From: Pedro Ballesteros Date: Mon, 17 Feb 2014 16:22:05 +0100 Subject: [PATCH] doc: stdout blocking or non-blocking behaviour Makes clear that the behaviour of stdout is blocking in Linux/Unix even when they refer to pipes. --- doc/api/process.markdown | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/doc/api/process.markdown b/doc/api/process.markdown index 8cb613525d..9d3125ce91 100644 --- a/doc/api/process.markdown +++ b/doc/api/process.markdown @@ -125,9 +125,13 @@ Example: the definition of `console.log` }; `process.stderr` and `process.stdout` are unlike other streams in Node in -that writes to them are usually blocking. They are blocking in the case -that they refer to regular files or TTY file descriptors. In the case they -refer to pipes, they are non-blocking like other streams. +that writes to them are usually blocking. + +- They are blocking in the case that they refer to regular files or TTY file + descriptors. +- In the case they refer to pipes: + - They are blocking in Linux/Unix. + - They are non-blocking like other streams in Windows. To check if Node is being run in a TTY context, read the `isTTY` property on `process.stderr`, `process.stdout`, or `process.stdin`: @@ -149,9 +153,13 @@ See [the tty docs](tty.html#tty_tty) for more information. A writable stream to stderr. `process.stderr` and `process.stdout` are unlike other streams in Node in -that writes to them are usually blocking. They are blocking in the case -that they refer to regular files or TTY file descriptors. In the case they -refer to pipes, they are non-blocking like other streams. +that writes to them are usually blocking. + +- They are blocking in the case that they refer to regular files or TTY file + descriptors. +- In the case they refer to pipes: + - They are blocking in Linux/Unix. + - They are non-blocking like other streams in Windows. ## process.stdin