nodejs 守护进程
const spawn = require('child_process').spawn;
const child = spawn(process.argv[0], ['child_program.js'], {
detached: true,
stdio: 'ignore'
});
child.unref();
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
上次更新: 2023/10/16, 17:53:06 访问次数: 0
const spawn = require('child_process').spawn;
const child = spawn(process.argv[0], ['child_program.js'], {
detached: true,
stdio: 'ignore'
});
child.unref();