Created
March 27, 2013 08:38
-
-
Save michaellopez/5252717 to your computer and use it in GitHub Desktop.
node-unzip event testcase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var unzip = require('unzip'); | |
| var path = 'output'; | |
| var file = 'file.zip'; | |
| var unzipStream = unzip.Extract({ path: path }); | |
| unzipStream.on('finish', function () { console.log('Zipstream Finish') }); | |
| unzipStream.on('data', function () { console.log('Zipstream Data') }); | |
| unzipStream.on('error', function () { console.log('Zipstream Error') }); | |
| unzipStream.on('close', function () { console.log('Zipstream Close') }); | |
| unzipStream.on('end', function () { console.log('Zipstream End') }); | |
| var readStream = fs.createReadStream(file); | |
| readStream.pipe(unzipStream); | |
| readStream.on('finish', function () { console.log('Readstream Finish') }); | |
| readStream.on('data', function () { console.log('Readstream Data') }); | |
| readStream.on('error', function () { console.log('Readstrem Error') }); | |
| readStream.on('close', function () { console.log('Readstream Close') }); | |
| readStream.on('end', function () { console.log('Readstream End') }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment