返回连接到 stdout (fd 1) 的流。 如果 fd 1 指向文件,则返回可写流,否则返回 net.Socket(也就是 Duplex 流)。

例子,将 process.stdin 拷贝到 process.stdout


process.stdout 与其他的 Node.js 流有很大的不同,详见进程I/O的注意事项

The process.stdout property returns a stream connected to stdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is a Writable stream.

For example, to copy process.stdin to process.stdout:


process.stdout differs from other Node.js streams in important ways, see note on process I/O for more information.