Skip to content

velo-textZero-deps document platform

Beta 1.0.4 · TypeScript strict · Variables {{name}} · PDF

Quick start 1.0.4 ​

This is a beta. APIs can still change. Install the prerelease tag:

bash
pnpm add velo-text@beta

Requires Node >= 18. Token and publish steps: Publish to npm.

ts
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 } });

Architecture in 30s ​

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.

Zero runtime dependencies — TypeScript strict — MIT