twitter/hogan.js — pull request #85 by MatthewMueller (2012-06-10 03:45:25+00:00)
Title: Fixes client-side rendering

Fixes the case where you compile the templates on the server into functions, then serve them to the frontend for use.

Example:

On the server:

var hogan = require('hogan.js');
var tpl = require('fs').readFileSync('./template.mu', 'utf8');
console.log("var template = " + hogan.compile(tpl, {asString : true})); // Save output file as `template.js`

On the client: