node-unzip icon indicating copy to clipboard operation
node-unzip copied to clipboard

unzip.Parse() doesn't work according to docs

Open jameslaneconkling opened this issue 9 years ago • 2 comments

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?

jameslaneconkling avatar Oct 16 '15 22:10 jameslaneconkling

Any update on this ? Because I have the same problem

pgol2 avatar Mar 20 '16 11:03 pgol2

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').

erhhung avatar Aug 18 '16 23:08 erhhung