This is a pure JS (front to back) of perl's Template Toolkit:
Yes, I'm aware of the Jemplate module, but that uses perl to produce a .js file which isn't of much use for a project like flusspferd (a JS shell+common modules):
http://github.com/ruediger/flusspferd/tree/master
Play around with a live demo at