
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
@json-render/core
Advanced tools
JSON becomes real things. Define your catalog, register your components, let AI generate.
Core library for json-render. Define schemas, create catalogs, generate AI prompts, and stream specs.
npm install @json-render/core zod
import { defineSchema } from "@json-render/core";
export const schema = defineSchema((s) => ({
spec: s.object({
root: s.object({
type: s.ref("catalog.components"),
props: s.propsOf("catalog.components"),
children: s.array(s.self()),
}),
}),
catalog: s.object({
components: s.map({
props: s.zod(),
description: s.string(),
}),
actions: s.map({
description: s.string(),
}),
}),
}), {
promptTemplate: myPromptTemplate, // Optional custom AI prompt generator
});
import { defineCatalog } from "@json-render/core";
import { schema } from "./schema";
import { z } from "zod";
export const catalog = defineCatalog(schema, {
components: {
Card: {
props: z.object({
title: z.string(),
subtitle: z.string().nullable(),
}),
description: "A card container with title",
},
Button: {
props: z.object({
label: z.string(),
variant: z.enum(["primary", "secondary"]).nullable(),
}),
description: "A clickable button",
},
},
actions: {
submit: { description: "Submit the form" },
cancel: { description: "Cancel and close" },
},
});
// Generate system prompt for AI
const systemPrompt = catalog.prompt();
// With custom rules
const systemPrompt = catalog.prompt({
system: "You are a dashboard builder.",
customRules: [
"Always include a header",
"Use Card components for grouping",
],
});
The SpecStream format uses JSONL patches to progressively build specs:
import { createSpecStreamCompiler } from "@json-render/core";
// Create a compiler for your spec type
const compiler = createSpecStreamCompiler<MySpec>();
// Process streaming chunks from AI
while (streaming) {
const chunk = await reader.read();
const { result, newPatches } = compiler.push(chunk);
if (newPatches.length > 0) {
// Update UI with partial result
setSpec(result);
}
}
// Get final compiled result
const finalSpec = compiler.getResult();
SpecStream format (each line is a JSON patch):
{"op":"set","path":"/root/type","value":"Card"}
{"op":"set","path":"/root/props","value":{"title":"Hello"}}
{"op":"set","path":"/root/children/0","value":{"type":"Button","props":{"label":"Click"}}}
import {
parseSpecStreamLine,
applySpecStreamPatch,
compileSpecStream,
} from "@json-render/core";
// Parse a single line
const patch = parseSpecStreamLine('{"op":"set","path":"/root","value":{}}');
// { op: "set", path: "/root", value: {} }
// Apply a patch to an object
const obj = {};
applySpecStreamPatch(obj, patch);
// obj is now { root: {} }
// Compile entire JSONL string at once
const spec = compileSpecStream<MySpec>(jsonlString);
| Export | Purpose |
|---|---|
defineSchema(builder, options?) | Create a schema with spec/catalog structure |
SchemaBuilder | Builder with s.object(), s.array(), s.map(), etc. |
| Export | Purpose |
|---|---|
defineCatalog(schema, data) | Create a type-safe catalog from schema |
catalog.prompt(options?) | Generate AI system prompt |
| Export | Purpose |
|---|---|
createSpecStreamCompiler<T>() | Create streaming compiler |
parseSpecStreamLine(line) | Parse single JSONL line |
applySpecStreamPatch(obj, patch) | Apply patch to object |
compileSpecStream<T>(jsonl) | Compile entire JSONL string |
| Export | Purpose |
|---|---|
Spec | Base spec type |
Catalog | Catalog type |
SpecStreamLine | Single patch operation |
SpecStreamCompiler | Streaming compiler interface |
json-render supports completely different spec formats for different renderers:
// React: Element tree
{ root: { type: "Card", props: {...}, children: [...] } }
// Remotion: Timeline
{ composition: {...}, tracks: [...], clips: [...] }
// Your own: Whatever you need
{ pages: [...], navigation: {...}, theme: {...} }
Each renderer defines its own schema with defineSchema() and its own prompt template.
FAQs
JSON becomes real things. Define your catalog, register your components, let AI generate.
The npm package @json-render/core receives a total of 508,322 weekly downloads. As such, @json-render/core popularity was classified as popular.
We found that @json-render/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.