fflate

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

Library
npm
v0.8.3
2,981stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
45/100Fair
Development Activity16
Maintenance20
Community44
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
88/100Excellent
Architecture90
Code Quality85
Innovation88
Learning Curve80

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 31 apps in this directory

TypeScript
94%
MIT

Actual

Invoicing Finance

28,224

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
77
Dependency
Built with
TypeScript94%
Updated yesterday
TypeScript
88%
Other

AFFiNE

Productivity · Project Management · Note Taking

71,668

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
68
Dependency
Built with
TypeScript88%
Updated today
TypeScript
59%
Other

agenta

Developer Tools · Devops · AI Development

4,489

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
TypeScript59%
Python39%
Updated today
TypeScript
72%
AGPL 3.0

APITable

Low Code Platforms · Databases

15,526

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

View details
53
Repo Health
77
Technical
60
Dependency
Built with
TypeScript72%
Java22%
Updated 9 months ago
TypeScript
75%
GPL 3.0

Bramble

Password Manager · Security · Authentication

315

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
73
Repo Health
84
Technical
72
Dependency
Built with
TypeScript75%
Updated today
Rust
67%
MIT

Bun

Developer Tools

95,452

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
66
Dependency
Built with
Rust67%
C++19%
Updated today
TypeScript
72%
Other

Epicenter

Knowledge Management · Note Taking · Developer Tools

4,761

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
68
Dependency
Built with
TypeScript72%
Svelte15%
Updated today
Rust
87%
MIT

fabro

Developer Tools · Devops

1,516

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

View details
81
Repo Health
83
Technical
70
Dependency
Built with
Rust87%
TypeScript11%
Updated yesterday
TypeScript
71%
Other

highlight.io

Developer Tools · Analytics · Monitoring

9,367

Open-source full-stack monitoring that unifies session replay, error tracking, logging, and distributed tracing so you can stop context-switching between tools.

View details
69
Repo Health
78
Technical
66
Dependency
Built with
TypeScript71%
Go16%
Updated yesterday

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