0

为什么 Class:child_process.stdin 是可写流?我该如何推理? https://nodejs.org/api/child_process.html#child_process_child_stdin


背景:

新手来了 做 nodeschool 流冒险的“双工”问题。

我在这个问题上苦苦挣扎,而我(错误地)认为接口require('duplexer2')([Writable Stream],[Readable Stream])应该用作require('duplexer2')(child.stdout, child.stdin)

4

1 回答 1

0

这都是关于观点的,child.stdin 对于子进程是可读的,但对于与之通信的任何外部进程(包括您正在编写的父进程)都是可写的。类似地,child.stdout 对于外部进程是可读的。

这很令人困惑,我只是自己想出来的,所以你的公司很好。

于 2016-09-08T08:57:40.883 回答