Embedded JS Templates
Another great templating library, Embedded JS takes inspiration from ERB templates, besides offering similar usability. The tags it uses are same as ERB, along with having many features which are same. It also includes helpers which are inspired by Ruby on Rails. The prime feature which makes EJS different is that it requires that the templates should be placed in separate files. Then the filename can be passed into EJS. Once the file is loaded, you get back HTML. You might also notice that its working is quite similar to Underscore. But you will across aspect like ‘link_to’, which is a helper defined by EJS for making the process of linking easier. It involves many others like this too, which you can explore online.
Handlebars is another highly popular templating engine, however it is build on Mustache. It means that whichever things were possible in Mustache template will be possible in Handlebars templates as well. Handlebars brings along a number of helpers into Mustache. One such helper is ‘with’ and it is ideal when you work with deeper objects. Handlebars is a prime choice of many who utilize it for their client side templating. Also you can come across many methods which can allow the expansion of Handlebars.
Jade Templates vary a lot in terms of their immense dependence on whitespace and indents. Jade is a popular option especially while templating for server side. As you can see the wide spread popularity of NodeJS, which is signified by the innumerable web pages that are built using it these days, the number of templating libraries being designed for using on this server is also increasing. Among all the templating libraries that have been mentioned above, Jade templates are highly different, mainly because it depends considerably on whitespace and indents. Jade might appear to be a bit jarring to some initially; however you soon get familiar with it.
With this we conclude our list of five highly popular and useful templating engines. Although you can find many more, but these are good for providing you an initial start and then select the one which suits your requirements the best.