Mykybo
Mykybo

Reputation: 1509

What templating engine to use with node js

I have node js BE. I only want to implement layouts - include header and footer on all pages. Templating engines such as pug (jade), ejs, etc seem like an overkill for this purpose.

What would you recommend?

Also might be relevant: I am most likely going to end up using either angular or react, are they a valid way to implement this (layouts)?

Upvotes: 2

Views: 1978

Answers (3)

Surjeet Bhadauriya
Surjeet Bhadauriya

Reputation: 7166

You can also use Handlebars(.hbs). It also provides lot of options which are good and easy to use and configurable.

Here is the link:

  1. https://www.npmjs.com/package/handlebars
  2. http://handlebarsjs.com/precompilation.html

Upvotes: 0

Pranesh Ravi
Pranesh Ravi

Reputation: 19133

React itself has a powerful template engine. Create a single layout page and include all your components into that layout. It'll be a single page app with the layout as the base and the content inside changes based on the user action.

Upvotes: 1

J o
J o

Reputation: 104

I use mustache, it is easy to use with lots of options. By the way, a template engine does not depend on if you use node.js or not, right.

Upvotes: 0

Related Questions