Case StudiesProductsBlogOpen SourceBook a call

version-json

Effortless versioning for long-lived JSON payloads.

version-json is a lightweight utility for managing and upgrading long-lived JSON data structures. You define transformation functions for each version, and it upgrades incoming payloads to the latest shape—keeping your data consistent as your schema evolves.

Links:


What it does

Example

const upVersion = new VersionJson("version");

upVersion
  .add(1, (p) => p)
  .add(2, (p) => {
    p.newData = p.data;
    delete p.data;
    return p;
  });

const newData = upVersion.process({ version: 1, data: "hello world" });
// => { version: 2, newData: "hello world" }

Why it exists

If you persist JSON in a database, local cache, config files, or synced documents, schemas inevitably change. version-json gives you a clear, explicit place to keep migrations so you can accept older payloads without scattering compatibility logic throughout your codebase.

“We created version-json to simplify the process of managing evolving JSON data structures, making data migrations effortless and reliable.” — The Sparkstone Team

This remind you of a problem you've been dealing with?

I'd be happy to discuss it with you and see if it's something we could turn into a solution.

Book a call

Newsletter

Subscribe to my newsletter to be the first to hear about what I do next