pako

A fast, zlib-compatible compression library for JavaScript that runs identically in the browser and Node.js.

Library
npm
v3.0.1
6,114stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
80/100Excellent
Development Activity96
Maintenance52
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
78/100Good
Architecture88
Code Quality85
Innovation65
Learning Curve75

pako is a JavaScript port of zlib, the C compression library behind gzip and countless network protocols. It reimplements zlib’s deflate and inflate algorithms directly in JavaScript rather than wrapping a native binary, so the exact same code runs in browsers and in Node.js with no build step or platform-specific binaries to manage.

The project’s headline claim is binary-equivalent output: pako can produce the same deflate/gzip bytes as the reference zlib implementation, which matters for anything that needs to interoperate byte-for-byte with existing zlib/gzip tooling, not just decompress data that happens to be gzip-shaped. Performance is close to native zlib in modern JS engines, and the minified bundle is small (under 15K gzipped for the full build, with smaller deflate-only and inflate-only builds available for size-sensitive browser code).

pako exposes both simple one-shot helpers (deflate/inflate/gzip/ungzip) for small buffers and streaming Deflate/Inflate classes for chunked processing of larger data, mirroring the ergonomics of Node’s built-in zlib module while working in environments where that module isn’t available.

What You Get

  • One-shot helper functions (deflate, inflate, deflateRaw, inflateRaw, gzip, ungzip) for compressing or decompressing an entire buffer in one call
  • Streaming Deflate and Inflate classes that accept data in chunks via .push(), for processing large payloads without holding everything in memory at once
  • Binary-equivalent output to reference zlib, so compressed data interoperates byte-for-byte with server-side gzip/zlib tooling
  • Separate deflate-only and inflate-only browser bundles (in addition to the full bundle) to keep client-side payload size down
  • Built-in UTF-8 string handling — deflate auto-detects string input and encodes it, and inflate can decode straight back to a JavaScript string with toText: true
  • Support for zlib’s advanced options (dictionaries, window bits, memory level, compression strategy) for callers who need fine-grained control

Common Use Cases

  • Compressing data client-side in the browser before sending it to a server, where a native zlib binding isn’t available
  • Decompressing gzip- or deflate-encoded API responses or file formats inside a browser or edge/serverless runtime with no native module support
  • Building tools that must produce or consume zlib/gzip streams that are byte-identical to what standard zlib produces (e.g. testing, format compatibility, or environments that verify checksums against a reference implementation)
  • Streaming compression/decompression of large files in chunks to avoid loading an entire payload into memory
  • Compressing JSON payloads (e.g. JSON.stringify output) before storage or transmission, then inflating them back into JavaScript objects

Under The Hood

Architecture pako is organized as a thin public API (src/index.ts, src/deflate.ts, src/inflate.ts) layered directly on top of a faithful JavaScript port of zlib’s internal C sources under src/zlib/ (deflate.mjs, inflate.mjs, inftrees.mjs, inffast.mjs, trees.mjs, adler32.mjs, crc32.mjs, zstream.mjs, gzheader.mjs, constants.mjs), mirrored one-to-one against zlib’s own module boundaries specifically to keep the port maintainable and behaviorally identical to upstream zlib. The public Deflate/Inflate classes and one-shot helper functions wrap a ZStream object and drive it through the low-level zlibDeflate*/zlibInflate* functions exported from src/zlib.mjs, handling chunk accumulation, dictionary application, and UTF-8 string coercion so callers never touch the zlib-level state machine directly; nothing else in the tree can change without touching this same layering, since every public entry point ultimately funnels through the same ZStream-driven core.

Tech Stack The library is written in TypeScript (compiled with a strict tsconfig.json targeting ESNext modules) with a .mjs-suffixed internal zlib port that ships as part of the package, avoiding any native addon or WASM dependency. The build pipeline uses Rollup (rollup-plugin-dts for type bundling) via a custom support/build-dist.mjs script to produce CommonJS, ESM, and minified browser UMD bundles from a single source tree, with vite used for local example/dev tooling and typedoc generating published API docs. Linting runs through ESLint 9 with the neostandard shareable config, and the package publishes typed .d.ts definitions alongside every build target.

Code Quality Tests live under test/ and run via Node’s built-in node:test runner (deflate.test.mjs, inflate.test.mjs, chunks.test.mjs, strings.test.mjs, gzip_specials.test.mjs, dist.test.mjs), asserting output against Node’s native zlib module and fixture files under test/fixtures/ to validate binary-equivalence claims directly rather than only checking round-trip correctness. The npm test script chains linting, a full build, a TypeScript type-check (tsc --noEmit), and the test run together, and c8 provides coverage reporting; CI (.github/workflows/ci.yml) runs this same suite on every push and pull request plus a weekly scheduled run. TypeScript’s strict mode and consistent zlib-derived naming conventions across the low-level modules keep the port’s internals easy to cross-reference against upstream C zlib.

API Design pako’s public surface stays close to Node’s built-in zlib module and to common JS async idioms, so developers already familiar with server-side gzip handling can adopt it with almost no new concepts: one-shot functions for simple cases, streaming classes with a .push(chunk, isLast) pattern for large data, and automatic string/UTF-8 handling that removes a common source of encoding bugs. Documentation is dense but thorough for a small library — the README covers install, both API styles, dictionary usage, and string handling with runnable examples, and generated TypeDoc API docs are published separately for full option-by-option reference.

Used by 19 apps in this directory

TypeScript
99%
Other

Activepieces

Automation · AI Assistants

24,298

Open-source AI automation platform that converts 280+ workflow integrations into MCP servers for LLMs, with no-code builders and TypeScript extensibility.

View details
92
Repo Health
85
Technical
64
Dependency
Built with
TypeScript99%
Updated today
TypeScript
89%
Other

anytype-ts

Knowledge Management · Note Taking · Collaboration

8,755

A local-first, end-to-end encrypted knowledge OS that lets you build notes, tasks, wikis, and entire apps — with your data stored offline and synced peer-to-peer.

View details
88
Repo Health
78
Technical
67
Dependency
Built with
TypeScript89%
Updated 2 days ago
TypeScript
99%
AGPL 3.0

Cherry Studio

AI Assistants

51,521

All-in-one AI desktop client with 300+ assistants and multi-model support

View details
89
Repo Health
84
Technical
71
Dependency
Built with
TypeScript99%
Updated today
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,640

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
69
Repo Health
76
Technical
62
Dependency
Built with
JavaScript90%
Updated 1 weeks ago
TypeScript
94%
AGPL 3.0

Element Web

Team Chat · Collaboration

13,437

A polished, self-hostable Matrix client for secure, decentralized messaging and collaboration that puts your organization in full control of its data.

View details
96
Repo Health
83
Technical
65
Dependency
Built with
TypeScript94%
Updated yesterday
JavaScript
64%
Other

GDevelop

Developer Tools · Game Development · Design Tools

26,276

No-code, open-source game engine for building 2D, 3D and multiplayer games — publish to iOS, Android, Steam and the web.

View details
93
Repo Health
82
Technical
61
Dependency
Built with
JavaScript64%
C++23%
TypeScript12%
Updated yesterday
TypeScript
38%
Apache 2.0

Label Studio

AI Development · Data Engineering

28,222

Label Studio is an open-source, multi-type data labeling platform that lets teams annotate images, text, audio, video, and time series data with a configurable XML-based UI and export annotations in formats ready for any ML framework.

View details
93
Repo Health
87
Technical
67
Dependency
Built with
TypeScript38%
JavaScript27%
Python25%
Updated today
TypeScript
65%
Apache 2.0

Laminar

AI Development · Monitoring

3,230

Open-source observability platform purpose-built for AI agents — trace, evaluate, debug, and monitor at scale with SQL access and real-time replay.

View details
85
Repo Health
76
Technical
69
Dependency
Built with
TypeScript65%
Rust33%
Updated yesterday
Python
68%
MIT

Langflow

AI Agents · AI Development

154,349

Build, test, and deploy AI agents and RAG workflows visually with native API and MCP server export.

View details
90
Repo Health
85
Technical
65
Dependency
Built with
Python68%
TypeScript23%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search