在JavaScript中,spawn是一个用于创建子进程的函数,通常用于执行外部命令或者其他可执行文件。spawn函数返回一个ChildProcess对象,该对象可以用于与子进程进行交互。 其中,command是要执行的命令 ...
Node.js学习指南第二版第8章讲的是child_process,用来创建子进程执行操作系统Shell命令的。 书中的代码示例只给了UNIX版本的代码,在Linux和OSX系统上可以使用,但是在Windows系统上无法工作。
As you can see, as soon as node exits process.stdin goes back to bash rather than being handled by ping. runs in foreground when not detached (this works as documented, I'm using it as an example as ...