node-stream-zip
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -541,3 +541,3 @@ /** | ||
} | ||
if (relPath && !allDirs[relPath] && relPath[0] !== '.') { | ||
if (relPath && !allDirs[relPath] && relPath !== '.') { | ||
allDirs[relPath] = true; | ||
@@ -547,2 +547,11 @@ var parts = relPath.split('/').filter(function (f) { return f; }); | ||
dirs.push(parts); | ||
while (parts.length > 1) { | ||
parts = parts.slice(0, parts.length - 1); | ||
var partsPath = parts.join('/'); | ||
if (allDirs[partsPath] || partsPath === '.') { | ||
break; | ||
} | ||
allDirs[partsPath] = true; | ||
dirs.push(parts); | ||
} | ||
} | ||
@@ -549,0 +558,0 @@ } |
{ | ||
"name": "node-stream-zip", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "node.js library for reading and extraction of ZIP archives", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -30,3 +30,3 @@ # node-stream-zip [](https://travis-ci.org/antelle/node-stream-zip) | ||
// Handle errors | ||
zip.on('error', err => { /*handle*/ }); | ||
zip.on('error', err => { /*...*/ }); | ||
``` | ||
@@ -38,3 +38,3 @@ | ||
console.log('Entries read: ' + zip.entriesCount); | ||
for (const entry of Object.values(entries)) { | ||
for (const entry of Object.values(zip.entries())) { | ||
const desc = entry.isDirectory ? 'directory' : `${entry.size} bytes`; | ||
@@ -51,3 +51,2 @@ console.log(`Entry ${entry.name}: ${desc}`); | ||
zip.on('ready', () => { | ||
// stream to stdout | ||
zip.stream('path/inside/zip.txt', (err, stm) => { | ||
@@ -54,0 +53,0 @@ stm.pipe(process.stdout); |
39648
901
139