我正在寻找类似的东西。
fs.copy([dir1,dir2], 'destDirString').then(() => {
cb();
});
是否有一种简单的方法来复制两个目录'内容到节点中的另一个目录?我现在有两个NCP命令,想要压缩。
答案 0 :(得分:0)
您可能正在寻找merge-dirs
用法:
var mergedirs = require('merge-dirs');
// copy folder/a into folder/b
mergedirs('/folder/a', '/folder/b');
// copy folder/a into folder/b with conflict resolution 'overwrite'
mergedirs('/folder/a', '/folder/b', 'overwrite');
// copy folder/a into folder/b with conflict resolution 'ask'
mergedirs('/folder/a', '/folder/b', 'ask');
// copy folder/a into folder/b with conflict resolution 'skip'
mergedirs('/folder/a', '/folder/b', 'skip');