node.js 调用 shelljs 接收 stdin 输入输出

#node.js 调用 shell 脚本 现在能见到的有很多很多种方法 今天和大家分享的是 shelljs shelljs 安装 npm install shelljs --save shelljs 使用 exec 方法 var shell = require("shelljs"); // exec 方法 shell.exec("echo hello world!"); shelljs 使用全局模式 require('shelljs/global'); mkdir('-p', '/var/log'); cp('-R', '/var/log/*', '/home/zhang
  • 1

回到顶部