pm2

run.js

1
2
3
4
5
6
7
8
9
10
//run
const { exec } = require('child_process')
exec('hexo server -i 0.0.0.0 -p 8020 -d',(error, stdout, stderr) => {
if(error){
console.log('exec error: ${error}')
return
}
console.log('stdout: ${stdout}');
console.log('stderr: ${stderr}');
})