fflate

High-performance DEFLATE, GZIP, Zlib, and ZIP compression for JavaScript in an 8kB package.

Library
npm
v0.8.3
3,065 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
43 /100 Fair
Development Activity 8
Maintenance 20
Community 44
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
88 /100 Excellent
Architecture 90
Code Quality 85
Innovation 88
Learning Curve 80

fflate (fast flate) is a pure-JavaScript compression and decompression library that delivers the speed of native code in a fraction of the bundle size. It supports DEFLATE, GZIP, Zlib, and ZIP formats, works identically in the browser and Node.js, and produces output fully interoperable with standard tools like zlib and gzip.

Despite weighing roughly 8kB minified (as little as 3kB for inflate-only builds), fflate outperforms popular alternatives such as pako, UZIP.js, and tiny-inflate on both compression ratio and throughput. It adds streaming APIs, multi-threaded asynchronous compression via Web Workers, dictionary support, and ZIP archiving without pulling in any dependencies.

What You Get

  • Synchronous one-shot helpers (gzipSync, unzlibSync, decompressSync) for quick compression and decompression of Uint8Array data
  • Streaming classes (Gzip, Inflate, Deflate, Decompress) that process data incrementally chunk by chunk
  • Asynchronous, multi-threaded variants that offload work to Web Workers for up to 3x throughput on large payloads
  • Full ZIP archiving and extraction, including nested directories, per-file options, and streaming ZIP support
  • String and UTF-8 conversion utilities (strToU8, strFromU8, EncodeUTF8, DecodeUTF8) plus automatic format detection

Common Use Cases

  • Compressing API payloads or uploads in the browser before sending them over the network
  • Reading and writing ZIP archives client-side without a server round-trip
  • Decompressing GZIP/Zlib assets fetched at runtime while keeping the bundle tiny
  • Streaming compression of large files that would not fit comfortably in memory

Under The Hood

Architecture

The entire library lives in a single, densely optimized src/index.ts (~121kB of source) that implements the DEFLATE algorithm from RFC 1951 directly against typed arrays. Core lookup tables (fleb, fdeb, clim, precomputed Huffman reverse tables) are built once at module load, and the compressor/decompressor operate on Uint8Array/Uint16Array/Int32Array buffers to stay allocation-light. Higher-level format wrappers (GZIP, Zlib, ZIP) layer headers and checksums over the shared DEFLATE core, while streaming is modeled as stateful classes with an ondata(chunk, final) callback. Asynchronous variants (src/node-worker.ts, src/worker.ts) marshal work onto Web Workers / worker threads to parallelize compression.

Tech Stack

Written entirely in TypeScript (100% of the codebase) with zero runtime dependencies. It compiles to CommonJS, ESM, and UMD bundles via tsc plus a Terser minification step, with a Parcel-built browser demo. Package exports are carefully mapped in package.json to serve node/browser and import/require conditions with matching type declarations, and sideEffects: false enables aggressive tree-shaking.

Code Quality

The repo ships a substantial uvu-based test suite under test/ covering validity, bundle size, performance, ZIP handling, streams, and async modes (files 0-valid.ts through 5-async.ts). Benchmarks compare fflate against pako, UZIP.js, and tiny-inflate. The source trades readability for extreme performance and size — heavily aliased identifiers and bit-twiddling — but is annotated with references to the underlying RFCs and design notes.

API Design The public API is ergonomic and consistent: paired *Sync and streaming/async variants share option shapes (level, mem, filename, mtime), and format detection (decompressSync, Decompress) removes guesswork. Named exports let consumers import only what they need, and the typedoc-generated reference under docs/ documents every function, class, and interface. Getting started requires only a Uint8Array and a single call.

Used by 35 apps in this directory

Go
75%
Other

Notifuse

Marketing

2,256

Open-source, self-hosted alternative to Mailchimp, Brevo, and Klaviyo — send newsletters and transactional emails without per-email pricing or vendor lock-in.

View details
83
Repo Health
80
Technical
65
Dependency
Built with
Go 75%
TypeScript 22%
Updated 1 weeks ago
TypeScript
95%
MIT

OmniRoute

AI Agents

80,476

A free, open-source AI gateway connecting Claude Code, Codex, Cursor, Cline, and Copilot to 237 AI providers (90+ free) through one endpoint, with automatic fallback and token-compression to stretch free-tier limits further.

View details
87
Repo Health
70
Technical
70
Dependency
Built with
TypeScript 95%
Updated 6 days ago
TypeScript
97%
GPL 3.0

OpenKnowledge

Code Editors · Knowledge Management · Note Taking

4,674

A beautiful, local-first markdown IDE that turns any git repo into a live collaborative workspace for humans and AI coding agents like Claude, Codex, and OpenCode.

View details
80
Repo Health
89
Technical
64
Dependency
Built with
TypeScript 97%
Updated 6 days ago
TypeScript
90%
MIT

open-pencil

AI Design Tools · Design Tools

9,227

An open-source design editor that reads native Figma files, ships a built-in AI assistant with 100+ design tools, and offers real-time serverless collaboration — all without giving up your files.

View details
84
Repo Health
78
Technical
69
Dependency
Built with
TypeScript 90%
Updated 1 weeks ago
TypeScript
99%
Other

openclaude

AI Agents · AI Code Assistants

34,123

Run Claude Code workflows against any LLM — OpenAI, Gemini, Ollama, and 200+ backends — from a single terminal-first CLI.

View details
87
Repo Health
78
Technical
71
Dependency
Built with
TypeScript 99%
Updated 6 days ago
TypeScript
54%
Other

OpenReplay

Analytics

13,042

Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.

View details
91
Repo Health
77
Technical
66
Dependency
Built with
TypeScript 54%
Go 13%
Updated 1 weeks ago
Python
73%
AGPL 3.0

OpenViking

AI Development · AI Memory · Databases

40,705

An open-source context database that gives AI agents a unified filesystem for memory, resources, and skills with hierarchical tiered retrieval.

View details
85
Repo Health
75
Technical
64
Dependency
Built with
Python 73%
TypeScript 12%
Rust 11%
Updated 6 days ago
Elixir
80%
AGPL 3.0

Plausible Analytics

Analytics

29,631

Open-source, cookie-free web analytics that respects visitor privacy and replaces Google Analytics.

View details
88
Repo Health
84
Technical
71
Dependency
Built with
Elixir 80%
TypeScript 15%
Updated 1 weeks ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 6 days ago

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