
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@nanocollective/json-up
Advanced tools
Transform & migrate JSON data to new schemas, with type-safe validation using Zod.
Useful for local JSON that evolves over time, like app settings, saved documents, or cached data.
npm install @nanocollective/json-up zod
Docs | Getting Started | API Reference
A migration is a step that transforms your data from one version to the next. When your data structure changes over time, migrations let you upgrade old data to match your current format.
Imagine you have user profiles stored as JSON, saved to a file.
Originally, you stored a single name field.
Now, in your latest app, you want to split it into firstName and lastName.
You could write if statements, but this gets risky as more changes come along.
So how can you safely update the state?
import { createMigrations, migrate } from "@nanocollective/json-up";
import { z } from "zod";
// Define your migrations
const migrations = createMigrations()
.add({
version: 1,
schema: z.object({ name: z.string() }),
up: (data) => ({ name: data.name ?? "Unknown" }),
})
.add({
version: 2,
schema: z.object({ firstName: z.string(), lastName: z.string() }),
up: (data) => {
const [firstName = "", lastName = ""] = data.name.split(" ");
return { firstName, lastName };
},
})
.build();
// Migrate old data to the latest version
const old = { _version: 1, name: "Jane Doe" }
const result = migrate({
state: old,
migrations,
});
console.log(result);
// { _version: 2, firstName: "Jane", lastName: "Doe" }
MIT
FAQs
A TypeScript JSON migration tool with Zod schema validation
The npm package @nanocollective/json-up receives a total of 186 weekly downloads. As such, @nanocollective/json-up popularity was classified as not popular.
We found that @nanocollective/json-up demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.