Book Image

Mastering Web Application Development with Express

By : Alexandru Vladutu
Book Image

Mastering Web Application Development with Express

By: Alexandru Vladutu

Overview of this book

Table of Contents (18 chapters)
Mastering Web Application Development with Express
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

The different types of template engines


Template engines are tools that help us separate the application logic from the presentation layer. They usually combine multiple templates with a data model, thus improving the maintenance and flexibility of our web applications.

There are a lot of template engines that we can install with NPM and use in Express and perhaps in the browser too. They can be split into the following categories:

  • Logic-less template engines: Their goals are to have no explicit control-flow statements and to make it impossible to embed application logic

  • Template engines with logic: These engines allow us to use JavaScript or DSL code and evaluate it within the templates

  • Programmatic template engines: These are engines that build HTML from scratch or augment it using data

Next, we are going to talk about each category and see what solutions are available for them in the NPM registry.

Logic-less template engines

A big advantage of this type of template engine is that it forces...