
Name to use for the object storing local variables when not using `with`. Use 'locals' object for vars rather than using `with` (implies -strict). When set to `true`, generated function is in strict mode Use CHARACTER instead of right angle bracket to close. Use CHARACTER instead of left angle bracket to open.
Use CHARACTER with angle brackets for open/close (defaults to %). Use parsed input from STRING as data for rendering. Use parsed input from FILE as data for rendering. Write the rendered output to FILE rather than stdout. Options are similar to those used in JavaScript code:
(Depends on async/await support in the JS runtime.ĮJS ships with a full-featured command-line interface.
async When true, EJS will use an async function for rendering.
outputFunctionName Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags. toString()ed in the generation of client functions. escape The escaping function used with <%= construct. 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). rmWhitespace Remove all safe-to-remove whitespace, including leading and trailing whitespace. localsName Name to use for the object storing local variables when not using with Defaults to locals. If false then the locals will be stored in the locals object. _with Whether or not to use with() constructs. strict When set to `true`, generated function is in strict mode. openDelimiter Character to use for opening delimiter, by default ''. delimiter Character to use for inner delimiter, by default '%'. client Returns standalone compiled function. compileDebug When false no debug instrumentation is compiled. views An array of paths to use when resolving includes with relative paths. Can be array to try to resolve include from multiple directories. root Set project root for includes with an absolute path (e.g, /file.ejs). filename Used by cache to key caches, and for includes. cache Compiled functions are cached, requires filename.