Very simple to use library for doing templating with Mustache.js, another templating engine that we will be looking at shortly. With ICanHaz.js you define your Mustache.js template snippets in script blocks of type=”text/html” and give them an “id” as a title for your snippet (which validates, btw).
Twitter loves to be a part of the open-source community. You can use Hogan.js as a part of your asset packager to compile templates ahead of time or include it in your browser to handle dynamic templates.
Again, includes the same style that Mustache.js does, only delivers everything in a much more quick and efficient manner.
Handlebars.js is an extension to the Mustache templating language created by Chris Wanstrath. Handlebars.js and Mustache are both logicless templating languages that keep the view and the code separated like we all know they should be.
It’s no doubt the most popular templating engine in the world right now, and almost every single library listed in this post is somehow related to, or inspired by Mustache. The documentation is very easy to read and understand, and highly recommended to use – works on pretty much every programming language that’s above average popularity level.
Just something for the Node.js community. doT.js is fast, small and has no dependencies. It was built in order to find the breaking point for speed and flexibility, and it certainly has achieved that feat.
In modern web apps, there’s often a good amount of presentation logic involved. This logic doesn’t belong in your application code, your backbone models, or anywhere else but the presentation layer. The templating language is a good place to put this.
It aims to provide the essentials in such a compact manner that speed or templating doesn’t feel like an issue of its own, rather, Walrus is focused on making it easy for the developer to template his web apps.
It’s the smallest templating engine you’ll come across, guaranteed. It’s also Mustache compilant and is very easy to use and understand, the official homepage features a great demo example that you can run and test code with, and on the GitHub page there are benchmarks and unit tests concluded, to show the efficiency of this library.
It’s compatible with Node.js, and has a very easy to understand syntax.
Built by Mozilla, Nunjucks is for those who need fast performance and flexibility that’s offered by the ability to extend the library with custom features and plugins.
Jade is designed primarily for server side templating in node.js, however it can be used in many other environments. It is only intended to produce XML like documents (HTML, RSS etc.) so don’t use it to create plain text/markdown/CSS/whatever documents.
Dust extends Mustache, and offers high quality performance compared to other solutions you might find in this list. Also includes a very easy to use, clean API.
I didn’t try to provide samples, simply because a lot of these have live preview of samples available on their official documentation pages, and I don’t see the point in doing the same thing twice.
I hope that you were able to discover some new alternatives to use for your next project. I’m sure there are more of these out there, though these are the ones that made their presence felt the most.