7.3 Handlebars
To give you a better idea of working with template engines in Node.js, this chapter covers not only Pug but also Handlebars. The following sections are intended to show you that features similar to those in Pug are available in other template engines and that you’re relatively free to choose which tools you want to use.
What is noticeable from the first contact with Handlebars is that the templates are written in HTML and not in a custom markup language. The advantage of this is that you don’t have to learn a new markup language, but can work directly with the familiar HTML. Furthermore, numerous tools are available for editing HTML that make your work easier. Another difference from Pug is that the core of Handlebars is deliberately ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access