EvanOxfeld / node-unzip

node.js cross-platform unzip using streams
MIT License
615 stars 343 forks source link

handle finish and error events to avoid dead _flush loop #112

Open hellolwq opened 6 years ago

hellolwq commented 6 years ago

samples.zip

sample zip files will cause unzip in dead _flush loop, handle the error and finish events can avoid this.

ZJONSSON commented 6 years ago

fyi, your sample file works with an active fork unzipper

const request = require('request');
const unzipper = require('unzipper');

request('https://github.com/EvanOxfeld/node-unzip/files/1678258/samples.zip')
  .pipe(unzipper.Parse())
  .on('entry', entry => entry.autodrain())
  .promise()
  .then( () => console.log('done'), e => console.log('error',e));