Skip to content

Render

@aurorajs.dev/catalyst-cli


@aurorajs.dev/catalyst-cli / generator/engine/template-engine / render

render(templatePath, data): string

Defined in: generator/engine/template-engine.ts:112

Render an .eta template file found under the codegen templates directory with injected utility namespaces. Returns the rendered source as a string.

string

Absolute or templates-dir-relative path to the .eta file. Absolute paths under the codegen templates dir are accepted and stripped to the relative form Eta expects.

TemplateData

Values passed to the template. They appear as it.<key> inside the template, together with the injected helper namespaces.

string

If the template renders to a non-string value (e.g. an Eta compile error swallowed by an async helper).

<%~ it.gen.importManager({ imports }) %>
<% it.filters.getEnumProperties(it.schema.aggregateProperties).forEach((p) => { -%>
export const <%= it.fmt.pascal(p.name) %> = '<%= p.name %>';
<% }) -%>