我想在节点中创建一个tar归档文件。该canonical tar archiving example是基于文件流:节点:将字符串作为文件添加到tar归档文件中(无临时文件)
fstream
.Reader({path: 'src', type: "Directory"})
.pipe(tar.Pack())
.pipe(zlib.createGzip())
.pipe(fstream.Writer("output.tar.gz"));
我的数据实际上是在内存中作为一个字符串,我想写信给存档,而无需创建一个临时文件之间。
有什么办法可以做到这一点,例如:也许从字符串中创建一个fstream?
如何从字符串创建流:http://stackoverflow.com/questions/12755997/how-to-create-streams-from-string-in-node-js –