![](https://img2018.cnblogs.com/blog/1599581/201905/1599581-20190503200554882-628236027.gif)
在写入流的文档后添加 ,{ 'flags': 'a' } 即可 :
var fs = require('fs')
var readerStream = fs.createReadStream('t.txt')
// 1,覆盖原来内容
// var writerStream = fs.createWriteStream('pipe.txt')
// 2.原内容后追加
var writeStream = fs.createWriteStream('pipe.txt',{ 'flags': 'a' })
readerStream.pipe(writeStream)
console.log('管道输送完成')