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

@agentine/bellows

v0.1.0

Published

Drop-in replacement for pako — zlib compression library for Node.js and browsers with native API delegation, TypeScript-first, zero dependencies

Readme

@agentine/bellows

Drop-in replacement for pako — zlib compression library for Node.js and browsers.

  • TypeScript-first — built-in types, no @types/pako needed
  • Native delegation — Node.js zlib module + browser CompressionStream
  • Zero dependencies
  • ESM + CJS dual package with conditional exports
  • pako-compatible API — deflate, inflate, gzip, ungzip, streaming classes

Install

npm install @agentine/bellows

Usage

import { deflate, inflate, gzip, ungzip } from '@agentine/bellows';

// Compress
const compressed = deflate('Hello, World!');

// Decompress
const decompressed = inflate(compressed, { to: 'string' });
// => 'Hello, World!'

// Gzip
const gzipped = gzip('Hello, World!');
const original = ungzip(gzipped, { to: 'string' });

Streaming

import { Deflate, Inflate } from '@agentine/bellows';
import { Z_FINISH } from '@agentine/bellows';

const deflater = new Deflate({ level: 9 });
deflater.push(data, Z_FINISH);
if (deflater.err) throw new Error(deflater.msg);
const compressed = deflater.result;

Raw deflate

import { deflateRaw, inflateRaw } from '@agentine/bellows';

const compressed = deflateRaw(input);
const decompressed = inflateRaw(compressed);

Migration from pako

Replace your import:

-import pako from 'pako';
+import * as pako from '@agentine/bellows/compat/pako';

Or use the direct API (same function names):

-import { deflate, inflate } from 'pako';
+import { deflate, inflate } from '@agentine/bellows';

API

Sync Functions

| Function | Description | |---|---| | deflate(input, options?) | Compress (zlib format) | | deflateRaw(input, options?) | Compress (raw deflate) | | gzip(input, options?) | Compress (gzip format) | | inflate(input, options?) | Decompress (zlib format) | | inflateRaw(input, options?) | Decompress (raw deflate) | | ungzip(input, options?) | Decompress (gzip format) |

Streaming Classes

  • new Deflate(options?) — streaming compression
  • new Inflate(options?) — streaming decompression

Both support push(data, flushMode), onData, onEnd, result, err, msg.

Options

| Option | Type | Description | |---|---|---| | level | 0-9 | Compression level (0=none, 9=best) | | windowBits | number | 8-15 zlib, -8 to -15 raw, 16+x gzip | | memLevel | 1-9 | Memory usage | | strategy | number | Z_DEFAULT_STRATEGY, Z_FILTERED, etc. | | dictionary | Uint8Array | Preset dictionary | | to | 'string' | Return string instead of Uint8Array | | chunkSize | number | Streaming chunk size |

Constants

All pako/zlib constants are exported: Z_NO_FLUSH, Z_FINISH, Z_OK, Z_STREAM_END, Z_NO_COMPRESSION, Z_BEST_COMPRESSION, Z_DEFAULT_STRATEGY, etc.

Browser Support

The browser build uses the CompressionStream/DecompressionStream API (Chrome 80+, Firefox 113+, Safari 16.4+).

Limitations vs Node.js backend:

  • Functions are async (return Promises) — CompressionStream is inherently async
  • level, strategy, memLevel, dictionary options are not supported
  • Streaming class push() callbacks fire asynchronously

For sync compression in the browser, use the pako compat layer which imports the Node.js backend (suitable for SSR/bundlers with Node.js polyfills).

License

MIT