Skip to content

Instantly share code, notes, and snippets.

@manuels
Created January 31, 2012 21:21
Show Gist options
  • Save manuels/1712984 to your computer and use it in GitHub Desktop.
Save manuels/1712984 to your computer and use it in GitHub Desktop.
Running Hem with Haml and Eco
var hem = new (require('hem'));
var haml = require('haml');
var eco = require('eco');
var fs = require('fs');
var argv = process.argv.slice(2);
hem.compilers.haml = function(path) {
var content = fs.readFileSync(path, 'utf8')
var template;
template = haml(content)()
template = eco.precompile(template)
return 'module.exports = '+template;
};
hem.exec(argv[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment