JSON compression · six languages · v1.0
json-compress
Lossless JSON compression that is still JSON. It writes every key name once instead of once per record, turns arrays of like-shaped objects into columns and rows, hoists out the columns whose value never changes, and de-duplicates the values that keep coming back. Record-shaped documents come out 45–75% smaller, and decompress hands back exactly what went in — key order included.
It began as an internal helper for moving large result sets between a database layer and a set of front ends, where the payloads were dominated by repeated field names. It kept being copied from project to project, so we wrote it properly, specified the wire format so it could be ported, and then ported it — six times, into JavaScript, .NET, Python, PHP, Go and Rust.
$ npm install @tech-style/json-compress
$ pip install json-compress
$ composer require tech-style/json-compress
6 Interoperable Implementations
Key Catalogue
Columnar Tables
Constant & Dictionary Columns
Value De-duplication
Byte-perfect Round Trip
Zero Dependencies
npm · NuGet · PyPI · Packagist · pkg.go.dev · crates.io
TypeScript Types
CLI Included
Documented Wire Format
MIT
The six implementations do not merely interoperate — they write the same bytes. Each is checked on every build against a shared corpus of 144 documents, in both directions: it must restore every envelope the reference encoder wrote, and write those same envelopes itself. Compress in a Python job, restore in a Go worker, in any combination. Java is planned against the same specification.