Socket
Socket
Sign inDemoInstall

readzip

Package Overview
Dependencies
8
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    readzip

read zip archive in simplest possible way


Version published
Weekly downloads
288
decreased by-20.22%
Maintainers
1
Install size
135 kB
Created
Weekly downloads
 

Readme

Source

Readzip License NPM version Dependency Status Build Status Coverage Status

Read zip archive in simplest possible way.

Install

npm i readzip

API

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.

  • 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

Keywords

FAQs

Last updated on 18 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc