What a powerful template engine for NodeJS?


Advise please a powerful and popular template engine for NodeJS.

I used the Handlebars and me he was satisfied, but now there are a couple of problems:
  1. There is no possibility to specify multiple views to generate (you may need to form different pages of the same parts, for example the form of adding the same two pages), that is for example to pass an array: res.render('table', 'form');
  2. It is impossible to do in wusah all sorts of comparisons, etc. (if viewName == 'table')

The first and second problem can be solved using helpers, but I want a more simple solution.

In PHP I was fine with Smarty, everything was done without any problems. Looking for something similar which will generate all on starone of the server. I saw there is even a Smarty to NodeJS, but not very popular...
June 14th 19 at 19:13
1 answer
June 14th 19 at 19:15
Try nunjucks - https://mozilla.github.io/nunjucks/

1. For such things it has a macro:
macro allows you to define reusable chunks of content. It is similar to a function in a programming language.

2. You can use expressions in the templates (although I handlebars, they also have like).
looks good, will try, thanks! - halle.Klocko commented on June 14th 19 at 19:18

Find more questions by tags HandlebarsNode.jsSmartyTemplate builders