Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via pnpm

yauzl 2.10.0

yet another unzip library for node
Package summary
Share
0
issues
1
license
4
MIT
Package created
22 Aug 2014
Version published
3 Jul 2018
Maintainers
2
Total deps
4
Direct deps
2
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
4 Packages, Including:
buffer-crc32@0.2.13
fd-slicer@1.1.0
pend@1.2.0
yauzl@2.10.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

2
All Dependencies CSV
β“˜ This is a list of yauzl 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
buffer-crc320.2.134.07 kBMIT
prod
fd-slicer1.1.07.34 kBMIT
prod

Visualizations

Frequently Asked Questions

What does yauzl do?

Yauzl is an efficient unzip library designed for Node.js. The library follows the principles of not blocking the JavaScript thread, not scanning for local file headers, and ensuring low memory usage by not buffering entire files in RAM at once. It focuses on providing asynchronous APIs for careful, foolproof, and performant handling of ZIP files. Yauzl also emphasizes the importance of error handling, catching unsafe file names, and providing resilience against malformed zip files to ensure that client applications do not run into issues.

How do you use yauzl?

In order to use yauzl, first, ensure it has been installed by running npm install yauzl on your command line. Once installed, include yauzl in your JavaScript file by using the require statement.

var yauzl = require("yauzl");

To open, read, and perform operations on a zip file, use the open method. The code snippet below exhibits how to open a zip file and read its contents:

yauzl.open("path/to/file.zip", {lazyEntries: true}, function(err, zipfile) {
  if (err) throw err;
  zipfile.readEntry();
  zipfile.on("entry", function(entry) {
    if (/\/$/.test(entry.fileName)) {
      zipfile.readEntry();
    } else {
      zipfile.openReadStream(entry, function(err, readStream) {
        if (err) throw err;
        readStream.on("end", function() {
          zipfile.readEntry();
        });
        readStream.pipe(somewhere);
      });
    }
  });
});

In the example, we open a file, read directory entries one by one, open a readable stream for each file entry, then pipe the readStream to a destination.

Where are the yauzl docs?

The documentation for yauzl is extensive and is primarily located on its GitHub repository README at https://github.com/thejoshwolfe/yauzl. The documentation effectively covers the usage of yauzl, providing in-depth descriptions of its API interfaces, usage principles, error handling procedures, design details, and the limitations it has with regards to the .zip file format. The README also contains valuable information on how yauzl handles data encoding, RHS timestamp and permission issues that are common when dealing with zip files from different operating systems.