Embedded JavaScript templates.
$ npm install ejs
- Complies with the Express view system
- Static caching of intermediate JavaScript
- Unbuffered code for conditionals etc
<% code %> - Escapes html by default with
<%= code %> - Unescaped buffering with
<%- code %>
<% if (user) { %>
<h2><%= user.name %></h2>
<% } %>
ejs.compile(str, options);
// => Function
ejs.render(str, options);
// => str
localsLocal variables objectcacheCompiled functions are cached, requiresfilenamefilenameUsed bycacheto key cachescontext|scopeFunction execution contextdebugOutput generated function body