Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Embedded JavaScript templates for node - Express compliant
Tag: 0.0.4

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
support
test
.gitmodules
History.md
Makefile
Readme.md
index.js
package.json

Readme.md

EJS

Embedded JavaScript templates.

Installation

$ npm install ejs

Features

  • 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 %>

Example

<% if (user) { %>
  <h2><%= user.name %></h2>
<% } %>

Usage

ejs.compile(str, options);
// => Function

ejs.render(str, options);
// => str

Options

  • locals Local variables object
  • cache Compiled functions are cached, requires filename
  • filename Used by cache to key caches
  • context|scope Function execution context
  • debug Output generated function body
Something went wrong with that request. Please try again.