I'm experimenting with building an entire web application using Node.js. Is there a template engine similar to (for example) the Django template engine or the like that at least allows you to extend base templates?

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
If this question can be reworded to fit the rules in the help center, please edit the question.

14

I just found out that JavaScript V8 engine is faster than Ruby, PHP, and Python. Amazingly fast for a dynamic language. Slower than Java and C#, though.
–
NosrednaNov 24 '09 at 19:10

Anyone who doesn't care about syntax, productivity and anything else but performance, should be using Raphters (web framework for C)
–
Pablo B.Apr 17 '11 at 0:27

5

node.js is not about the language. It's totally about the design and the way js handles IO, which is brilliant. You could make ruby web frameworks run fast if you redesigned it's IO libraries.
–
julkiewiczApr 25 '11 at 20:11

Jade is pretty cool. I've just started using it, so can't speak to it's performance, but I like the syntax. And built-in support in Express is a plus.
–
broofaNov 22 '10 at 13:41

3

the performance is sufficient, templates should be cached anyway. Plus remember to scale horizontally, not vertically, otherwise you might as well not use a template engine at all and just some functions / concats
–
tjholowaychukJan 28 '11 at 20:10

Thumbs up for underscore.js. Awesome library, I use it both for my client side as well as node.js work. Their templating engine is based on John Resig's JS Micro Templating engine (ejohn.org/blog/javascript-micro-templating) which I have used many times before. Afaik its your best option at this point when working with node.js.
–
felixgeNov 28 '09 at 11:36

2

Do any of these support inheritance?
–
Nick RetallackJan 4 '10 at 5:55

It's not similar to Django's templates at all, for one Django's templates have good documentation. EJS is a struggle to get through and you'll end up reading its source code just to understand what's available to you.
–
omouseJan 20 '14 at 4:27

Try Yajet too. ;-) It's a new one that I just released yesterday, but I'm using it for a while now and it's stable and fast (templates are compiled to a native JS function).

It has IMO the best syntax possible for a template engine, and a rich feature set despite its small code size (8.5K minified). It has directives that allow you to introduce conditionals, iterate arrays/hashes, define reusable template components etc.