Overview

What is json-to-spec?

A pure, zero-dependency JSON specification compiler that turns decoupled blueprints and data payloads into valid specifications ready for downstream DOM engines.

The 2-File Contract

Input A

structure.json (HOW)

Pure UI blueprint. Defines HTML tag hierarchies (tagName), styling classes, attributes, and declarative loop points via "operation": "iterate".

Input B

data.json (WHAT)

The single source of truth for all business values, column metadata, row records, summary calculations, and control visibility flags.

// Resulting Compilation Contract import { compile } from "https://keshavsoft.github.io/json-to-spec/dist/v1/min.js"; const spec = compile({ inStructure: structureBlueprint, inData: dataPayload }); // Returns standard spec JSON ready for json-to-dom

Deterministic & Pure

No side effects, no mutation of inputs. Given the same inputs, outputs are identical every time.

Environment Agnostic

Runs in browsers, Node.js, Web Workers, and serverless edge functions with zero DOM requirements.

Sub-Millisecond Fast

Stamps out hundreds of rows and columns in 0.1ms to 0.4ms across complex structures.