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

Choosing a template engine


It's not easy to choose a template engine considering that there are so many of them available with different features. Instead of choosing a clear winner, we should focus on what criteria we should have in mind when selecting them:

  • Do you plan on using it both with Express and the browser? A few examples include EJS, Handlebars.js, and Jade.

  • Should it have logic or not? Some of them support regular JavaScript (such as EJS), others just have the basics, while the rest disallow logic inside templates.

  • Is it widely used and maintained? To see a list of the most depended-on modules, check out the NPM registry (https://www.npmjs.org/browse/depended).

  • Should it be the best performing? It would be good to run benchmarks with potential use cases and see how they perform. However, if you are using a caching mechanism to store the whole responses, you might not need to touch the template engine more than a few times.

  • Does it precompile templates or not?

  • Should it support streaming...