fflate

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

Library
npm
v0.8.3
3,025 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

TypeScript
95%
MIT

Actual

Invoicing Finance

29,186

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
73
Dependency
Built with
TypeScript 95%
Updated 4 days ago
TypeScript
82%
Other

AFFiNE

Collaboration · Note Taking · Productivity

73,040

Write, draw, and plan in one infinite canvas — the open-source alternative to Notion and Miro that keeps your data yours.

View details
91
Repo Health
87
Technical
67
Dependency
Built with
TypeScript 82%
Rust 11%
Updated 5 days ago
TypeScript
56%
Other

agenta

AI Development · Developer Tools · Devops

4,788

The open-source LLMOps platform unifying prompt engineering, evaluation, and observability for teams building reliable LLM applications.

View details
91
Repo Health
77
Technical
67
Dependency
Built with
TypeScript 56%
Python 39%
Updated 5 days ago
TypeScript
72%
AGPL 3.0

APITable

Databases · Low Code Platforms

15,623

API-first collaborative spreadsheet-database platform that auto-generates REST APIs and lets teams build internal tools, CRMs, and dashboards without code.

View details
71
Repo Health
77
Technical
60
Dependency
Built with
TypeScript 72%
Java 22%
Updated 3 weeks ago
TypeScript
80%
GPL 3.0

Bramble

Authentication · Password Manager · Security

399

Local-first, end-to-end encrypted password manager that syncs your vault directly between your own devices over a private peer-to-peer mesh — no server, no account, no cloud in the middle.

View details
75
Repo Health
84
Technical
68
Dependency
Built with
TypeScript 80%
Updated 5 days ago
Rust
67%
MIT

Bun

Developer Tools

96,068

An all-in-one JavaScript and TypeScript toolkit — one Rust-and-JavaScriptCore binary that replaces Node.js, npm, a bundler, and a test runner with faster equivalents.

View details
92
Repo Health
91
Technical
64
Dependency
Built with
Rust 67%
C++ 19%
TypeScript 10%
Updated 5 days ago
TypeScript
96%
MIT

deepseek-harness

AI Agents · AI Development · Developer Tools

237,945

An open-source, plugin-based agent harness from DeepSeek AI that runs coding and automation agents across web, desktop, CLI, and SDK surfaces.

View details
81
Repo Health
89
Technical
74
Dependency
Built with
TypeScript 96%
Updated 5 days ago
TypeScript
64%
Other

Epicenter

Developer Tools · Knowledge Management · Note Taking

4,808

A local-first monorepo led by Whispering, an open-source speech-to-text app, built on an MIT toolkit that turns your data into plain Markdown and SQLite files you own instead of a database you rent.

View details
88
Repo Health
90
Technical
64
Dependency
Built with
TypeScript 64%
HTML 13%
Svelte 13%
Updated 5 days ago
Rust
80%
MIT

fabro

Developer Tools · Devops

1,658

Define AI agent workflows as code graphs, route tasks across any LLM, and intervene only where it matters.

View details
82
Repo Health
83
Technical
67
Dependency
Built with
Rust 80%
TypeScript 15%
Updated 5 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