Node.js --- spawn 殺死正在執行的子進程

const { spawn } = require('child_process'); var child = spawn('sleep', ['10s']); var kill = spawn('kill', [child.pid]); child.stdout.on('data', (data) => { console.log(`stdout: ${data}`); }); chil
相關文章
相關標籤/搜索