npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

unzip-web-stream

v1.0.0-beta.1

Published

A lightweight, cross-runtime ES8-compatible ZIP extraction tool leveraging Web Streams API for seamless streaming-based decompression, without dependencies.

Readme

unzip-web-stream

Streaming cross-platform & cross-runtime unzip tool written to match EcmaScript features and patterns

This package is ES replacement for "unzip-stream" (its own rewrite from ground) and provides simple APIs for parsing ZIP Structures and extracting zip files. It uses latest WebAPI Stream patterns from ES8 which allows it to use in every runtime environment following ES8 Web Stream standards. There are zero dependencies - inflation is handled in default by WebAPIs DecompressionStream transformer.

Notice

Keep in mind that the zip file format isn't inherently designed for streaming. While this library should work in most cases, if you have a complete zip file available, it's better to use libraries specifically built to read zip archives from the end, as originally intended—such as yauzl or decompress-zip.

Installation

npm install unzip-web-stream

Quick Examples

Streaming ZIP Extraction in Deno

This example demonstrates how to download and extract files from a ZIP archive while download streaming, using the unzip-web-stream library.

  • Fetches a large ZIP file from an external source.
  • Checks for a valid response before proceeding.
  • Extracts files and directories on-the-fly, writing them directly using Deno's filesystem API.

Ideal for processing large ZIP files efficiently without needing to load the entire archive into memory.

import {UnzipStreamConsumer} from "unzip-web-stream";

// Fetch ZIP file: 47MB
const response = await fetch('https://www.minecraft.net/bedrockdedicatedserver/bin-win-preview/bedrock-server-1.21.90.25.zip');

// Check for response
if(!response.ok || !response.body)
    throw new ReferenceError("Endpoint file not available");

// Extract files while downloading, using Deno runtime
await response.body.pipeTo(new UnzipStreamConsumer({
    async onFile(report, readable){
        const {path} = report;

        // Open new file handle and pipe readable stream there
        const fileHandle = await Deno.open(path, {write: true, create: true});
        readable.pipeTo(fileHandle.writable);
    },
    // Synced because directory must me always created before files
    onDirectory(report){ Deno.mkdirSync(report.path) }
}))

Custom Compression Handling in ZIP Extraction

This method is useful for two main cases:

  • Non-standard decompression – Allows handling custom compression formats beyond typical ZIP extraction.
  • Additional transformations – Enables further processing on extracted files before saving. This makes the pipeline flexible, supporting both special decompression methods and custom file manipulations during extraction.
await readable.pipeTo(new UnzipStreamConsumer({
    async onFile(report, readable){
        const {path} = report;

        // Open new file handle and pipe readable stream there
        const fileHandle = await Deno.open(path, {write: true, create: true});
        readable.pipeTo(fileHandle.writable);
    },

    // Thats how default build-in pipe transformer looks like, once you use pipeThrough you have to cover right compression method on your own
    pipeThrough(report, readable){
        // Handle edge cases for different compressions or custom transform streams in general
        if(report.compressionMethod === CompressionMethod.Deflate)
            return readable.pipeThrough(new DecompressionStream("deflate-raw"))

        return readable;
    }
}))