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
$ dotnet add package TechStyle.JsonCompress
$ go get github.com/eharain/JSON-Compress/go
6 Interoperable Implementations
Key Catalogue
Columnar Tables
Constant & Dictionary Columns
Value De-duplication
Byte-perfect Round Trip
Zero Dependencies
npm · NuGet · pkg.go.dev
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. JavaScript, .NET and Go are on their registries now; PHP, Python and Rust build from the repository while their releases are prepared. Java is planned against the same specification.