recpack: JSON that comes back byte for byte, 14 times smaller
Our desktop crawler keeps every page it reads and every Search Console export on the user's own disk. To make that fit, we wrote a small format that packs JSON records into columns and gives back the exact same text.
The short answer
- what
- recpack, an open-source format and library that packs JSON records into compressed columns, stores tables a column at a time, and archives files in checked chunks.
- why
- Plain JSON is huge, gzip alone loses nothing but cannot read one column without the rest, and most columnar formats change your data on the way back. We needed small, exact and readable a column at a time.
- who
- Node.js developers who store or move large arrays of JSON records — crawls, logs, analytics exports, snapshots — and need them back exactly as they were.
- where
- npm (`npm i @hromada/recpack`) and GitHub, under the Apache-2.0 licence. Node.js 22.15 or later.
- when
- Available now on npm, version 1.12; every format it ever wrote stays readable by later versions.
- how
- Values are rearranged into typed columns — bits, varints, dictionaries, time deltas, URL ids — and compressed with zstd or brotli from Node's own zlib; the reader rebuilds the original JSON text.
In plain words
If you keep a long list of similar records — web pages, clicks by day — most of what you store repeats: the same field names, the same kinds of values. recpack lines the values up in columns, like a spreadsheet, squeezes them, and when you open it again you get every character of the original back, so nothing else can tell it was ever packed.
Why we wrote it
GLLmolfar, our desktop crawler, does its work on the user's computer and keeps the results there: every crawled page, every saved crawl for comparison, every Search Console export. On big sites that is gigabytes of JSON. We needed it smaller, we needed to read a single column of a table without unpacking the rest, and we needed the data back exactly — not "equivalent", but the same text — because a crawl compared with last month's must not show differences the storage made up.
Nothing we tried did all three, so we wrote recpack, and then published it on its own.
The whole API, almost
Records go in, a block comes out, and the round trip is checked to the character:
import { pack, unpack, packTable, unpackTable } from "@hromada/recpack";
const block = pack(records); // columns + zstd
JSON.stringify(unpack(block)) === JSON.stringify(records); // always true
const file = packTable({ day: days, page: pages, clicks }, { delta: ["day"] });
const { cols } = unpackTable(file, { columns: ["clicks"] }); // only what you ask for"The same" includes the hard cases: key order, numbers larger than 2^53 that a JavaScript number would round, lone surrogates in strings. That promise is the format's reason to exist, and the tests check it on every block.
Try it on your own page
See what Brandscope finds on a page of yours
Everything above is measurable on your own work, and the check takes about a minute. Paste one address and read what comes back.
Open BrandscopeFree · no account · one at a time
The numbers, read honestly
On 200 real crawled pages, packed in batches of 50, the default codec makes them about 14.6 times smaller than JSON. The README is candid about where that comes from, and so are we: zstd alone already gets about 13 times on records like these. The columns add 13–19 % on top — more on records that repeat their structure, such as URLs, timestamps and status codes. What zstd alone does not give is the exact round trip through a columnar layout, and tables you can read a column at a time.
| Data | JSON | recpack | Write / read |
|---|---|---|---|
| 200 crawled pages, one block | 1.73 MB | 102 KB (×16.9) | — |
| Day × page history, 2.3 million rows | 51.2 MB | 8.8 MB (×5.8) | 1.3 s / 0.25 s |
| Page × query pairs, 100,000 rows | 16.3 MB | 1.1 MB (×14.4) | 0.16 s / 0.16 s |
Archives that move only what changed
archiveFile stores any file in checked chunks, either one megabyte each or content-defined: insert one byte at the start of a 16 MB file and 98 % of the chunks stay the same, so a sync sends only the changed ones. Video and images are stored as they are, because they are compressed already. This is how our hromada mesh sends a file again after an edit without sending all of it.
Safe with bytes you did not write
A format that reads files from elsewhere has to assume some of them are hostile. Anything wrong with a block, a table or an archive raises one kind of error, FormatError, never a crash of another kind, and every decoder has limits by default — on bytes, values, rows, cells and total size — so a crafted file cannot exhaust memory. A codec number is never reused, and two peers exchange what they can decode before they send.
What recpack does not do is encrypt or sign. That is deliberate: it is meant to travel inside a channel that does, such as hromada.
Free, small, and clear about what it is not
recpack is open source under the Apache-2.0 licence and has no dependencies at all — only Node's own zlib, which needs Node.js 22.15 or later for zstd. Its byte layout is written down in FORMAT.md with golden test vectors.
It is not a database: there are no indexes and no SQL, so use SQLite, DuckDB or Parquet for queries. There is no reader outside Node.js yet, it is not worth it for payloads of a few hundred bytes, and it does not run in browsers. The glossary keeps a short reference entry: recpack.
Questions people ask
Is the JSON really identical after unpacking?
Yes. JSON.stringify of the unpacked records equals JSON.stringify of the originals, character for character, including key order and very large numbers.
How is it different from zstd on its own?
It uses zstd underneath but first arranges records into columns, which adds 13–19 % on typical records, and it lets you read one column of a table without unpacking the rest.
What does it cost?
Nothing. It is open source under Apache-2.0, with no dependencies, no account and no paid tier.
The product
Watch it on every page, every day
One reading tells you where a page stands today. The product asks the same questions of the same assistants continuously, so a change is something you are told about rather than something you go looking for.
Request an invitationInvite-only while we keep the readings honest
On this topic
Is my page ready for AI search?
Every day Crawls with the Vectorscope reading beside every page, re-checked after each fix. How the product works
Author
Olexandrauthor
15+ years in marketing and SEO. Dozens of products, mostly the US market. Research and measurement.
LinkedInPass it on
Read in your language
Opens a browser translation of this English article. The original source stays in English.