Comparing version 0.9.0-rc5 to 0.9.0-rc6
@@ -25,2 +25,6 @@ var Stream = require('stream'); | ||
found = true; | ||
outStream.emit('entry',entry); | ||
entry.on('error',function(e) { | ||
outStream.emit('error',e); | ||
}); | ||
entry.pipe(outStream) | ||
@@ -37,3 +41,7 @@ .on('error',function(err) { | ||
inStream.pipe(Parse(opts)) | ||
.on('error',function(err) { | ||
outStream.emit('error',err); | ||
}) | ||
.pipe(transform) | ||
.on('error',Object) // Silence error as its already addressed in transform | ||
.on('finish',function() { | ||
@@ -40,0 +48,0 @@ if (!found) |
@@ -59,3 +59,3 @@ var Stream = require('stream'); | ||
p.write(packet,function() { | ||
if (!self.buffer.length) self.cb(); | ||
if (self.buffer.length === (eof.length || 0)) self.cb(); | ||
}); | ||
@@ -62,0 +62,0 @@ } |
{ | ||
"name": "unzipper", | ||
"version": "0.9.0-rc5", | ||
"version": "0.9.0-rc6", | ||
"description": "Unzip cross-platform streaming API ", | ||
@@ -5,0 +5,0 @@ "author": "Evan Oxfeld <eoxfeld@gmail.com>", |
39
test.js
@@ -1,17 +0,24 @@ | ||
var unzipper = require('./unzip') | ||
var request = require('request') | ||
const unzipper = require('./unzip'); | ||
const request = require('request'); | ||
const Stream = require('stream'); | ||
const fs = require('fs'); | ||
unzipper.Open.url(request, { url: 'https://tools.hana.ondemand.com/additional/sap-webide-personal-edition-1.45.3-prod-macosx.cocoa.x86_64.zip', headers: { Cookie: 'eula_3.1_agreed=tools.hana.ondemand.com/developer-license-3.1.txt' } }) | ||
.then(function (d) { | ||
console.log('got',d) | ||
var file = d.files.filter(function (d) { | ||
return d.path === 'artifacts.xml'; | ||
})[0]; | ||
return file.buffer(); | ||
}) | ||
.then(function (d) { | ||
console.log('hey',d.toString()); | ||
cb(); | ||
}) | ||
.catch((err) => console.log(err)); | ||
//request('http://geolite.maxmind.com/download/geoip/database/GeoLite2-City-CSV.zip') | ||
fs.createReadStream('/home/zjonsson/Downloads/GeoLite2-City-CSV_20170207.zip') | ||
.pipe(unzipper.Parse({})) | ||
.pipe(Stream.Transform({ | ||
transform: (entry,e,cb) => { | ||
console.log(entry) | ||
let path = /\/(.*)$/.exec(entry.path)[1]; | ||
console.log(path); | ||
entry.on('error', e => console.log(e)) | ||
.on('finish', () => console.log('done')); | ||
entry.pipe(fs.createWriteStream(path)) | ||
.on('finish',() => cb()); | ||
}, | ||
objectMode: true | ||
})) | ||
setTimeout(()=>null,1000) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
30119
629
0
3