child_process 执行系统shell命令

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/adley_app/article/details/87652952
var process = require('child_process');

process.exec('ls -af',function (error, stdout, stderr) {
    if (error !== null) {
      console.log('exec error: ' + error);
    }
    console.log(stdout);
    
});

猜你喜欢

转载自blog.csdn.net/adley_app/article/details/87652952