'close' 事件

  • code <number> 子进程的退出码。
  • signal <string> 终止子进程的信号。

当子进程的 stdio 流被关闭时触发。 与 'exit' 事件的区别是,多个进程可能共享同一 stdio 流。

  • code <number> The exit code if the child exited on its own.
  • signal <string> The signal by which the child process was terminated.

The 'close' event is emitted when the stdio streams of a child process have been closed. This is distinct from the 'exit' event, since multiple processes might share the same stdio streams.