ect

ect (GitHub: baryshev/ect, License: MIT) is a performance focused JavaScript template engine with embedded CoffeeScript syntax. Just try demo to check all features.

npm install ect

Features

  • Excellent performance
  • Templates caching
  • Automatic reloading of changed templates
  • CoffeeScript code in templates
  • Multi-line expressions support
  • Tag customization support
  • Node.JS and client-side support
  • Powerful but simple syntax
  • Inheritance, partials, blocks
  • Compatible with express
  • Compatible with RequireJS
  • Backward compatible with eco
  • Syntax highlighting for Sublime Text 2 by TurtlePie

Example

app.js

express = require("express")
app = express()
ECT = require("ect")
ectRenderer = ECT watch: true, root: __dirname + "/views"
app.engine ".ect", ectRenderer.render

app.get "/", (req, res) ->
  res.render "index.ect"

app.listen 3000
console.log "Listening on port 3000"

views/index.ect

<% extend 'layout.ect' %>
<div>Hello, World!</div>

views/layout.ect

<html>
  <body>
    <% content %>
  </body>
</html>

There are plenty of examples and information on baryshev/ect. Check it out!