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')
上一篇:vue3项目报错 Error: Cannot find module ‘vue-loader-v16/package.json‘


下一篇:四、Bug——WebClient、HttpWebRequest等方法下载远程url文件总是中断,抛出异常