REXC encoder, decoder, and data tool. Drop-in replacements for JSON.stringify and JSON.parse that produce smaller output, skip deserialization on read, and create near-zero heap allocations.
Why
JSON forces a tradeoff: parse everything up front (slow, memory-heavy) or don't cache at all. REXC eliminates the tradeoff:
18x smaller — binary-encoded numbers, de-duplicated strings, shared schemas, prefix-compressed paths.
— binary-encoded numbers, de-duplicated strings, shared schemas, prefix-compressed paths. 23,000x faster single-key lookup — O(log n) binary search on sorted indexes, directly on the encoded bytes. No parse step.
— O(log n) binary search on sorted indexes, directly on the encoded bytes. No parse step. Near-zero heap pressure — the parsed result is a Proxy over a flat byte buffer. The GC doesn't trace its contents.
Benchmarked on a real production dataset: a 35,000-key website deployment manifest.
Install
npm install @creationix/rx # library npm install -g @creationix/rx # CLI (global) npx @creationix/rx data.rx # CLI (one-off)
Quick Start
... continue reading