node--文件拷贝_微信


var fs = require('fs')
function fileCopy(src, target) {
const readStream = fs.createReadStream(src)//源文件路径
const writeStream = fs.createWriteStream(target)//目标文件路径
readStream.pipe(writeStream);
}

fileCopy('./1.txt', './2.txt')