因为此选项与 timeout 选项。
timeout
在 spawn 你必须决定何时杀死这个过程。
spawn
示例:( 来自doc )
const { spawn } = require('child_process'); const grep = spawn('grep', ['ssh']); grep.on('close', (code, signal) => { console.log( `child process terminated due to receipt of signal ${signal}`); }); // Send SIGHUP to process grep.kill('SIGHUP');