@visual-json/core
v0.2.0
Published
Headless core for visual-json — the visual JSON editor. Schema-aware, embeddable, extensible.
Readme
@visual-json/core
Headless core for visual-json — the visual JSON editor. Schema-aware, embeddable, extensible.
This package is framework-agnostic — it provides the data layer without any UI dependencies.
Install
npm install @visual-json/coreUsage
import { fromJson, toJson, setValue, addProperty } from "@visual-json/core";
// Convert a JSON value into an editable tree
const tree = fromJson({ name: "my-app", version: "1.0.0" });
// Mutate immutably — returns a new tree with structural sharing
const updated = setValue(tree, tree.root.children[0].id, "new-app");
// Convert back to plain JSON
const json = toJson(updated.root);API
Tree
Operations
All operations return a new TreeState with structural sharing.
Schema
Search & Diff
License
Apache-2.0
