getting-started.md
May 11, 2026 ยท View on GitHub
{% raw %}
5-Minute Setup
-
Install prerequisites:
- Node.js 22.12+ or 24.x
- pnpm 8.15.0
-
Clone and install dependencies:
corepack enable corepack prepare pnpm@8.15.0 --activate pnpm install pnpm build -
Create a template file
hello.md.tmpl:# Hello {{ user.name }} Items: {% for item in items %} - {{ item }} {% endfor %} -
Create a data file
data.json:{ "user": { "name": "Ada" }, "items": ["One", "Two", "Three"] } -
Render from CLI:
From monorepo root (development):
node src/packages/cli/dist/cli.js render -t hello.md.tmpl -i data.jsonAfter publishing (end users):
npx @templjs/cli render -t hello.md.tmpl -i data.json
Core Library Quick Start
import { renderTemplate } from '@templjs/core';
const output = renderTemplate('Hello {{ user.name }}', {
user: { name: 'Ada' },
});
console.log(output);
Architecture & Source
Design context (ADRs):
Implementation references:
- Core quick-start API export
renderTemplate: src/packages/core/src/index.ts - CLI entrypoint (
templjs renderwiring): src/packages/cli/src/cli.ts - CLI command export
renderCommand: src/packages/cli/src/commands/render.ts - CLI command export
validateCommand: src/packages/cli/src/commands/validate.ts - CLI command export
initCommand: src/packages/cli/src/commands/init.ts
VS Code Setup
-
Install the templjs VS Code extension package in this repository.
-
Prefer the
.tmplsuffix when creating template files:.md.tmpl,.json.tmpl,.yaml.tmpl,.html.tmpl
-
Compatibility suffixes remain supported when needed:
.md.templ,.json.templ,.yaml.templ,.html.templ.md.tpl,.json.tpl,.yaml.tpl,.html.tpl
-
Optionally configure schema-aware authoring:
{ "templjs.schemaPath": ".templjs/frontmatter.schema.json", "templjs.contentSchemaPath": ".templjs/content.schema.json", "templjs.schemas": { "backlog/**": { "schemaPath": ".templjs/work-item.frontmatter.schema.json", "contentSchemaPath": ".templjs/work-item.content.schema.json" } } }
Next Steps
- CLI reference: cli.md
- API reference: api-reference.md
- Curated examples: examples.md
{% endraw %}