Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "config"

Index

Type aliases

PartialConfig

PartialConfig: Partial<EtaConfig>

trimConfig

trimConfig: "nl" | "slurp" | false

Functions

configure

getConfig

  • Takes one or two partial (not necessarily complete) configuration objects, merges them 1 layer deep into eta.config, and returns the result

    Parameters

    • override: PartialConfig

      Partial configuration object

    • Optional baseConfig: EtaConfig

      Partial configuration object to merge before override

      Example

      let customConfig = getConfig({tags: ['!#', '#!']})

    Returns EtaConfig

includeHelper

  • includeHelper(this: EtaConfig, templateNameOrPath: string, data: object): string
  • Include a template based on its name (or filepath, if it's already been cached).

    Called like include(templateNameOrPath, data)

    Parameters

    • this: EtaConfig
    • templateNameOrPath: string
    • data: object

    Returns string

Object literals

config

config: object

Eta's base (global) configuration

async

async: false = false

autoEscape

autoEscape: true = true

autoTrim

autoTrim: [false, "nl"] = [false, 'nl']

cache

cache: false = false

e

e: XMLEscape = XMLEscape

include

include: includeHelper = includeHelper

plugins

plugins: never[] = []

rmWhitespace

rmWhitespace: false = false

tags

tags: [string, string] = ['<%', '%>']

templates

templates: Cacher<TemplateFunction> = templates

useWith

useWith: false = false

varName

varName: string = "it"

parse

parse: object

exec

exec: string = ""

interpolate

interpolate: string = "="

raw

raw: string = "~"

Generated using TypeDoc