Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/view_engine/node_modules/@types/ejs/index.d.ts>Options

🚀A Template View Engine for Deno frameworks
Latest
interface Options
import { type Options } from "https://deno.land/x/view_engine@v10.6.0/node_modules/@types/ejs/index.d.ts";

Properties

optional
debug: boolean

Log the generated JavaScript source for the EJS template to the console.

optional
compileDebug: boolean

Include additional runtime debugging information in generated template functions.

optional
_with: boolean

Whether or not to use with () {} construct in the generated template functions. If set to false, data is still accessible through the object whose name is specified by ejs.localsName (defaults to locals).

optional
strict: boolean

Whether to run in strict mode or not. Enforces _with=false.

optional
destructuredLocals: string[]

An array of local variables that are always destructured from localsName, available even in strict mode.

optional
rmWhitespace: boolean

Remove all safe-to-remove whitespace, including leading and trailing whitespace. It also enables a safer version of -%> line slurping for all scriptlet tags (it does not strip new lines of tags in the middle of a line).

optional
client: boolean

Whether or not to compile a ClientFunction that can be rendered in the browser without depending on ejs.js. Otherwise, a TemplateFunction will be compiled.

optional
escape: EscapeCallback

The escaping function used with <%= construct. It is used in rendering and is .toString()ed in the generation of client functions.

optional
filename: string

The filename of the template. Required for inclusion and caching unless you are using renderFile. Also used for error reporting.

optional
root: string

The path to the project root. When this is set, absolute paths for includes (/filename.ejs) will be relative to the project root.

optional
openDelimiter: string

The opening delimiter for all statements. This allows you to clearly delinate the difference between template code and existing delimiters. (It is recommended to synchronize this with the closeDelimiter property.)

optional
closeDelimiter: string

The closing delimiter for all statements. This allows to to clearly delinate the difference between template code and existing delimiters. (It is recommended to synchronize this with the openDelimiter property.)

optional
delimiter: string

Character to use with angle brackets for open/close

optional
cache: boolean

Whether or not to enable caching of template functions. Beware that the options of compilation are not checked as being the same, so special handling is required if, for example, you want to cache client and regular functions of the same file.

Requires filename to be set. Only works with rendering function.

optional
context: any

The Object to which this is set during rendering.

optional
async: boolean

Whether or not to create an async function instead of a regular function. This requires language support.

optional
beautify: boolean

Make sure to set this to 'false' in order to skip UglifyJS parsing, when using ES6 features (const, etc) as UglifyJS doesn't understand them.

optional
localsName: string

Name to use for the object storing local variables when not using with or destructuring.

optional
outputFunctionName: string

Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags.