Pure core, no DOM
Canonical JSON AST, immutable transactions, selection, history, validation and canonical hash. Zero window/document/fs in core.
Beta 1.0.4 · TypeScript strict · Variables {{name}} · PDF
This is a beta. APIs can still change. Install the prerelease tag:
pnpm add velo-text@betaRequires Node >= 18. Token and publish steps: Publish to npm.
import { createDocument, createIdGenerator, exportDocument } from "velo-text";
import { createBufferSink } from "velo-text/backend";
const doc = createDocument({ idGenerator: createIdGenerator("doc") });
doc.root.children.push({
type: "paragraph", id: "p1",
children: [{ type: "text", id: "t1", text: "Hello " }, { type: "variable", id: "v1", path: "name", source: "{{name}}", valueType: "string" }]
});
const { sink, getBuffer } = createBufferSink();
await exportDocument({ document: doc, data: { name: "Ada" }, format: "pdf", sink, options: { deterministic: true } });PortableDocument (AST JSON) — source of truth
├─ Core (model, ops, history, schema, normalize)
├─ Template (parser, resolver, formatter)
├─ Editor Web (view reconciler, input pipeline, tables, clipboard, a11y)
├─ Assets (sniff, dimensions, hashing, store, S3)
├─ Layout (units, text, pagination)
├─ Export (pdf, odt, docx)
├─ Theme (tokens, 4 presets)
└─ Adapters (browser, backend, PG, S3)Explore the Guide, Roadmap, and API. Try the Playground.