@metaobjectsdev/render
v1.0.13
Published
Logic-less, deterministic text render engine (Mustache) for MetaObjects templates — provider-resolved partials, format-driven escaping, zero core dependency.
Maintainers
Readme
@metaobjectsdev/render
Logic-less, deterministic text render engine (Mustache) for MetaObjects templates — provider-resolved partials, format-driven escaping, and stable, snapshot-testable output. Zero runtime dependency on the rest of MetaObjects.
Part of the MetaObjects monorepo.
Install
npm install @metaobjectsdev/renderWhat it provides
render()— render a MetaObjectstemplate.output/template.promptagainst a typed payload. Deterministic and cache-stable (no whitespace drift that would silently break exact-prefix prompt-cache hits), so output is snapshot-testable.- Provider-resolved partials + format-driven escaping (text / html / xml / csv / json / markdown).
- Providers —
InMemoryProvider(root entry, browser-safe) andFilesystemProvider(Node-only, on the@metaobjectsdev/render/providerssubpath so the root entry never pulls innode:fs).new FilesystemProvider("./prompts").resolve("lobby/welcome")reads./prompts/lobby/welcome.mustache, exactly as the C#, Java and Python ports do. verify()— a build-time drift check that every{{field}}referenced by a template resolves to a field on its payload value-object; a renamed field fails the build instead of silently degrading a prompt.
This engine backs the prompt-construction pillar — the generated render<Name>() helpers emitted by @metaobjectsdev/codegen-ts wrap it. See the metaobjects-prompts skill and the repo docs/ for authoring template.* and payload VOs.
