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

compression-rspack-plugin

v0.2.0

Published

Rust-native parallel compression plugin for Rspack. Drop-in replacement for compression-webpack-plugin with gzip, brotli, deflate, and deflateRaw — all parallelized across CPU cores via Rust + rayon.

Readme

compression-rspack-plugin

npm version CI license npm downloads coverage awesome-rstack

Rust-native parallel compression plugin for Rspack. Drop-in replacement for compression-webpack-plugin.

Compresses assets in parallel across all CPU cores via Rust + rayon, instead of serially on the Node.js main thread.

Install

npm install compression-rspack-plugin
# or
pnpm add compression-rspack-plugin
# or
yarn add compression-rspack-plugin

Prebuilt binaries are available for macOS (arm64, x64), Linux (x64 glibc, arm64 glibc, x64 musl). The correct binary is installed automatically via platform-specific optional dependencies.

Usage

import { CompressionRspackPlugin } from 'compression-rspack-plugin'

export default {
  plugins: [
    new CompressionRspackPlugin({ test: /\.(js|css|html|json|svg)$/ }),
    new CompressionRspackPlugin({ algorithm: 'brotliCompress', test: /\.(js|css|html|json|svg)$/ }),
  ],
}

Options

Same interface as compression-webpack-plugin. Validated via schema-utils.

| Option | Type | Default | Description | |---|---|---|---| | algorithm | string \| Function | "gzip" | "gzip", "brotliCompress", "deflate", "deflateRaw", or custom callback | | compressionOptions | object | {} | Passed to the algorithm. Defaults to max quality per algorithm. | | filename | string \| Function | "[path][base].gz" | Output template. "[path][base].br" for brotli. | | test | RegExp \| string \| Array | — | Include matching assets | | include | RegExp \| string \| Array | — | Include matching assets | | exclude | RegExp \| string \| Array | — | Exclude matching assets | | threshold | number | 0 | Min size in bytes | | minRatio | number | 0.8 | Only emit if compressed/original < this | | deleteOriginalAssets | boolean \| "keep-source-map" \| Function | false | Remove originals after compression |

Benchmarks

Tested on a production Rspack build (~1,400 assets, Apple M3 Pro 14-core).

| | compression-webpack-plugin | compression-rspack-plugin | |---|---|---| | Build time (avg of 3) | 82.7s | 37.3s (2.2x faster) | | Compression phase (RsDoctor) | 61.1s | 20.3s (3.0x faster) | | .gz files | 1,410 | 1,411 | | .br files | 1,444 | 1,444 | | gzip-6 / 1 KB | 106 MiB/s | 143 MiB/s (1.4x) | | gzip-6 / 100 KB | 0.66 GiB/s | 2.77 GiB/s (4.2x) | | gzip-6 / 1 MB | 0.66 GiB/s | 3.30 GiB/s (5.0x) | | deflate-6 / 1 MB | 0.69 GiB/s | 2.03 GiB/s (2.9x) |

How it works

Built-in algorithms (gzip, brotliCompress, deflate, deflateRaw) are handled by flate2 and brotli in Rust via a single napi-rs FFI call. Custom algorithms fall back to Node.js zlib.

Differences from compression-webpack-plugin

| | compression-webpack-plugin | compression-rspack-plugin | |---|---|---| | Compression | Node.js zlib (serial) | Rust rayon (parallel) + zlib fallback | | Compilation cache | Yes | Not yet | | Child compilations | Yes (scoped via thisCompilation) | Yes | | [compressed] stats flag | Yes | Registered, not rendered by rspack 2.0 beta |

Development

pnpm install        # install deps
pnpm build          # native addon + TypeScript
pnpm test           # JS tests (120 tests)
pnpm test:rust      # Rust unit tests
pnpm lint           # biome
pnpm lint:rs        # cargo fmt + clippy
pnpm typecheck      # tsc --noEmit

License

MIT