readzip
Advanced tools
read zip archive in simplest possible way
Weekly downloads
Changelog
readzip v1.0.1
Readme
Read zip archive in simplest possible way.
npm i readzip
path
contains information about current file, it has next methods:
isFile([name])
check if current entitiy
is file, also compares path, when name
passed;isDirectory([name])
checks if current entity
is directory, also compares path, when name
passed;openReadStream
- promise, returns file stream
;stop
- close archive file and break from traversing loop;Also path
has fields that can be used to get some information
name
size
date
mode
directory
type
owner
import readzip from 'readzip';
const archivePath = './hello.zip';
for await (const path of readzip(archivePath)) {
const {name} = path;
if (path.isFile()) {
console.log('file:', name);
}
if (path.isDirectory()) {
console.log('directory:', name);
}
}
Similar to info returned by readify.
dropbox
MIT