There are a lot of template languages available for Node.js. But how do you pick the right one?
This page aims to help you choose the template language that's best for you and your project.
(click to toggle) | CoffeeKup | EJS | Haml-js | Haml.js | Jade | JQTpl | Mu2 | Swig | Templ8 | Whiskers |
---|---|---|---|---|---|---|---|---|---|---|
Express Support | ✔ | ✔ | ✖ | ✔ | ✔ | ✔ | ✖ | ✔ | ✔ | ✔ |
Browser Support | ✔ | ✖ | ✔ | ✔ | ✔ | ✜ | ✜ | ✔ | ✔ | ✔ |
Available via npm | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Variable Filters | ✖ | ✔ | ✖ | ✖ | ✖ | ✖ | ✖ | ✔ | ✔ | ✖ |
Shorthand HTML Syntax | ✔ | ✖ | ✔ | ✔ | ✔ | ✖ | ✖ | ✖ | ✖ | ✖ | Extends / Block Template Inheritance | ✖ | ✖ | ✖ | ✖ | ✔ | ✖ | ✖ | ✔ | ✔ | ✖ |
Escapes Output | ✖ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✖ | ✖ |
Iteration | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
if/else Conditionals |
✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✜ | ✔ | ✔ | ✔ |
else if Conditionals |
✔ | ✔ | ✔ | ✖ | ✔ | ✖ | ✖ | ✔ | ✔ | ✖ |
Extendable Tags, Logic, and/or Filters | ✔ | ✖ | ✖ | ✖ | ✖ | ✔ | ✖ | ✔ | ✔ | ✖ |
Partials / Includes✜ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ | ✔ |
Footnotes | ||||||||||
✜ JQTpl Browser Support | JQTpl can be supported in the browser via the jQuery Templates plugin | |||||||||
✜ Mu Browser Support | Mu2/Mustache can be supported in the browser via mustache.js. | |||||||||
✜ Mu if / else |
Mu2/Mustache only supports if logic. |
|||||||||
✜ Partials | Language has some way to include and render sub-templates from within the main template. |