node-unzip
node-unzip copied to clipboard
unzip.Parse() doesn't work according to docs
It seems that in node v4.1.0, unzip.Parse()
does not work according to the docs.
This does not work:
res
.pipe(unzip.Parse())
.pipe(writeStream)
.on('finish', () => {
console.log('finish')
});
However, this does:
res
.pipe(unzip.Parse())
.on('entry', (entry) => entry.pipe(writeStream) )
.on('finish', () => {
console.log('finish')
})
Maybe the Stream API has changed?
Any update on this ? Because I have the same problem
I'm using Node 6.3 and have no issues. I don't get a finish
event, however, but a close
event.
Are you sure you're using writeStream = fstream.Writer('output/path')
from the fstream
package as shown in the example? The writeStream
object in entry.pipe(writeStream)
, on the other hand, is your standard fs.createWriteStream('output/path')
.