Skip to main content
Module

x/eta/config.ts>EtaConfig

Embedded JS template engine for Node, Deno, and the browser. Lighweight, fast, and pluggable. Written in TypeScript
Very Popular
Go to Latest
interface EtaConfig
import { type EtaConfig } from "https://deno.land/x/eta@v2.2.0/config.ts";

Index Signatures

[index: string]: any

Properties

autoEscape: boolean

Whether or not to automatically XML-escape interpolations. Default true

autoTrim: trimConfig | [trimConfig, trimConfig]

Configure automatic whitespace trimming. Default [false, 'nl']

async: boolean

Compile to async function

cache: boolean

Whether or not to cache templates if name or filename is passed

e: (str: string) => string

XML-escaping function

parse: { exec: string; interpolate: string; raw: string; }

Parsing options. NOTE: "-" and "_" may not be used, since they are reserved for whitespace trimming.

plugins: Array<{ processFnString?: Function; processAST?: Function; processTemplate?: Function; }>

Array of plugins

rmWhitespace: boolean

Remove all safe-to-remove whitespace

tags: [string, string]

Delimiters: by default ['<%', '%>']

Holds template cache

varName: string

Name of the data object. Default it

optional
filename: string

Absolute path to template file

optional
filepathCache: Record<string, string> | false

Holds cache of resolved filepaths. Set to false to disable

optional
filter: Function

A filter function applied to every interpolation or raw interpolation

optional
include: Function

Function to include templates by name

optional
includeFile: Function

Function to include templates by filepath

optional
name: string

Name of template

optional
root: string

Where should absolute paths begin? Default '/'

optional
useWith: boolean

Make data available on the global object instead of varName

optional
view cache: boolean

Whether or not to cache templates if name or filename is passed: duplicate of cache

optional
views: string | Array<string>

Directory or directories that contain templates