Literal templates
I introduce to you "literal-templates", a lightweight, flexible template engine for Node.js. Offering dynamic registration and rendering of template views, includes, and helpers.
I like to program as close to vanilla as possible. Because abstractions are complex. Seriously, why give a man a fish when you could teach him about asynchronous programming?
I've been paid to program for 13 years. People have paid me to write SQL, Java, PHP, C, and JavaScript. Which is ridiculous as it's just my hobby. I love to code.
I introduce to you "literal-templates", a lightweight, flexible template engine for Node.js. Offering dynamic registration and rendering of template views, includes, and helpers.
I've been thinking some more about using template strings as a view engine. This blog for example now uses the template engine shown below. It's quite simple to implement and it's usage in html files is super intuitive. You just need to remember that the html you are writing will be intepretted as a template string, and you already know how to use template strings, so there is no overhead.
Template strings in JS can be used to create a view engine without adding any extra libraries. So if you are creating a server side js app, think before you reach for handlebars, ejs, or god forbid pug. Not becuase those are bad, pug is, but becuase it's so easy to leverage template strings as a view engine.