2.0.0 • Published 2 years ago
readzip v2.0.0
Readzip

Read zip archive in simplest possible way.
Install
npm i readzipAPI
path contains information about current file, it has next methods:
isFile([name])check if currententitiyis file, also compares path, whennamepassed;isDirectory([name])checks if currententityis directory, also compares path, whennamepassed;openReadStream- promise, returns filestream;stop- close archive file and break from traversing loop;
Also path has fields that can be used to get some information
namesizedatemodedirectorytypeowner
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.
Related
- redzip - work with zip archives as it is regular files and directories
- readify - read directory content with file attributes: size, date, owner, mode
- readbox - read file or directory from
dropbox
License
MIT