shelljs node shell类似操作

1、简介

Node.js的Unix Shell命令

https://www.npmjs.com/package/shelljs

2、示例

var shell = require('shelljs');
// 文件拷贝
shell.cp('-R', 'test.js', 'test3.js');
// 路径操作
shell.cd('..');
// 输出路径
console.log(shell.pwd().stdout,'pwd')
原文地址:https://www.cnblogs.com/mengfangui/p/12314034.html