Created
January 31, 2012 21:21
-
-
Save manuels/1712984 to your computer and use it in GitHub Desktop.
Running Hem with Haml and Eco
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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