This is mainly just a FYI type post, but earlier this week I discovered Nunjucks, a client-side templating language by Mozilla. I've been pretty much sold on Handlebars as my template language, but Nunjucks has a lot going for it too. Out of the box it seems to support a lot more than Handlebars (inheritance and asynchronous support for example) and the template synax is as friendly as Handlebars'.
Of course, my only real requirement for template syntax is to not suck as bad as Jade but that's just me.
It supports client-side (obviously) and server-side (for Node) so it's ready to go pretty much anywhere. I'd love to see this supported in Harp in the future.
If you want to take it for a test drive, I built an online Nunjucks tester here: http://www.raymondcamden.com/demos/2014/oct/15/test.html. You can't test everything there of course (inheritance for example), but you can quickly test out some of the syntax and see how it feels.
Archived Comments
I think it "does more" because it breaks out of the "logicless templating" that Mustache and Handlebars try to enforce. Eg; {% set ... %}
Reminds me of Angular's filters. {{ foo | replace("foo", "bar") | capitalize }}
Good point there Ryan.
Helpful post, thanks. Would you prefer Nunjucks over Handlebars in Harp?
I've used Handlbebars in real apps. I know it works. I've only looked at this this week. It definitely *seems* cooler, but I won't know till I use it for a real app.
Nunjucks looks pretty cool... I've been messing around with Dust.js [http://akdubya.github.io/du...] it's pretty awesome...
LinkedIn has a port of Dust.js they use on the front end they proclaim to have optimized for performance...
https://github.com/linkedin...
Here's a couple other cool links to check out the LinkedIn port of dust if you're interested...
http://linkedin.github.io/d...
http://linkedin.github.io/d...
I looked at Dust before - it just didn't impress me enough to really try it. To be clear, I'm not saying it looked bad, it just didn't impress me *over* Handlebars (unlike Nunjucks).