7.4 Summary
In addition to the Pug and Handlebars engines presented here, numerous other implementations exist for Node.js. Another template engine also frequently encountered is Embedded JavaScript (EJS). As the name suggests, this is a comparatively simple yet flexible engine that has a flatter learning curve than Pug and is slightly more flexible than Handlebars. Like Handlebars, EJS uses HTML as a template language. Instead of the double curly brackets, <% and %> are used here as markers. The integration with Express is similarly smooth as with Pug. You can find the EJS project site at https://ejs.co.
Template engines are an indispensable tool that allows you to separate the view from the logic of your application. Templates not only ...
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