@templjs/corerenderTemplate(template, data, options?)Renders a template string with structured input data.
import { renderTemplate } from '@templjs/core';
const result = renderTemplate('Hello {{ user.name }}', {
user: { name: 'Ada' },
});
validateTemplate(template)Validates template syntax and returns { valid, errors? }.
import { validateTemplate } from '@templjs/core';
const result = validateTemplate('{% if user %}Hello{% endif %}');
tokenize(template) and parse(tokens)Low-level lexer and parser APIs for tooling and diagnostics.
SchemaValidatorSchema-backed data and query-path validation.
import { SchemaValidator } from '@templjs/core';
const validator = new SchemaValidator({
type: 'object',
properties: { user: { type: 'object' } },
});
createQueryEngine()Returns a query engine instance with built-in filter metadata.
Function catalog tests: src/packages/core/test/query-engine/query-engine.catalog.test.ts
extractTemplateScopeBindings(template)Extracts scope-relevant variable bindings for semantic tooling.
@templjs/clitempljs render -t template.md.templ -i data.json
Important flags:
--watch--input-format <json|yaml|toml|xml>--output-format <text|json|html|markdown>--json, --quiet, --verbose--no-validate-input, --no-validate-outputtempljs validate -t template.md.templ [-s schema.json] [-i data.json]
templjs init -f markdown [-o starter.md.templ]