@anzaui/engine - v0.6.0
    Preparing search index...

    Interface SetupOptions

    Options for Setup.

    interface SetupOptions {
        escape?: boolean;
        fragments?: string[];
        maxTemplateBytes?: number;
        root: string;
        signing?: SignOptions;
        watch?: boolean;
    }
    Index
    escape?: boolean

    HTML-escape {{name}} values; {{{name}}} stays raw. Default false: values are inserted as-is, so escape untrusted input with escapeHtml yourself.

    With escape: true, write {{{content}}} in layout/shell.html, otherwise the page HTML is escaped a second time.

    fragments?: string[]

    Fragment allowlist, see EngineOptions.fragments. Default: every template.

    maxTemplateBytes?: number

    Refuse template files larger than this many bytes with a TEMPLATE error. Default DEFAULT_MAX_TEMPLATE_BYTES (1 MiB).

    root: string

    The template root. Every .html file under it is loaded, named by its /-separated path relative to the root (e.g. feed/card.html).

    signing?: SignOptions

    How envelopes are signed. Default { mode: 'none' } (unsigned). The keys are checked in Setup.run, see SignOptions.

    watch?: boolean

    Reload all templates when a file under root changes. Default false.

    Uses fs.watch(root, { recursive: true }) (Node.js 20+ on Linux). A burst of events triggers one reload 50 ms after the last event, reloads never overlap, and a reload that fails (a half-written or oversized file) keeps the last good templates. Meant for development.