glebdmitriew / node-unzip-2

node.js cross-platform unzip using streams
MIT License
44 stars 39 forks source link

failed to get entry list if empty file in zip #12

Closed feiyuw closed 8 years ago

feiyuw commented 8 years ago

create a empty file, and add it to zip. Then using unzip module to get its entries as below:

  var entries = [];
  zipStream.pipe(unzip.Parse({verbose: true}))
  .on('entry', function(entry) {
    entries.push({path: entry.path});
    entry.autodrain();
  })
  .on('close', function() {
    console.log(entries); // there is no chance to fire close event
  });
feiyuw commented 8 years ago

same issue as #2

feiyuw commented 8 years ago

follow #2 instruction solve my issue, see https://github.com/lybicat/node-unzip-2