EvanOxfeld / node-unzip

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

Finished #75

Open mn1aC opened 9 years ago

mn1aC commented 9 years ago

How to fire the finished or end event?

niksumeiko commented 9 years ago

+1 I also don't get neither close, nor finish, nor end events triggered.

var request = require('request');
var unzip = require('unzip');

request('http://path/to/archive.zip').
    on('error', function(error) {
      console.error(error);

    }).on('close', function() {
      console.log('Successfully unzipped!');

    }).on('finish', function() {
      console.info('Weird `finish` got fired.');

    }).on('end', function() {
      console.info('Weird `end` got fired.');

    }).pipe(unzip.Extract({ path: 'output/path' }));

None of the console gets printed in CLI, means non of the subscribed events got triggered! Probably events emitting is done wrong or something…

Files are extracted, however! References #21

ZJONSSON commented 8 years ago

See also PR https://github.com/EvanOxfeld/node-unzip/pull/100 (temporarily published as unzipper on npm)