node-unzip
node-unzip copied to clipboard
Returns an 'invalid distance code' error.
Archive contains a number of text files. Archive works fine using unzip on unix.
{ [Error: invalid distance code] errno: -3, code: 'Z_DATA_ERROR' }
var fs = require('fs');
var unzip = require('unzip');
var path = 'archive.zip';
var incoming = fs.createReadStream(path).pipe(unzip.Parse());
incoming.on('error', function errorCB (error) {
if (error) {
callback(error);
return;
}
});
incoming.on('entry', function entryCB (entry) {
if (self._isArchive(entry.path) === false) {
entry.autodrain();
} else {
console.log(entry.path);
}
});