Closed liclac closed 9 years ago
The api is that simple actually - see the below 3 lines for more detail but you can provide the path to your hbs file - read that into your node program and ask this project to "precompile" it
var compiler = require('ember-template-compiler');
var template = fs.readFileSync('foo.handlebars').toString();
var compiledFunction = compiler.precompile(template, false);
console.log(compiledFunction); //you could return this to stdout /etc
Is there any chance you could make this callable from the commandline?
Something like
/path/to/compiler /path/to/infile.hbs
just spitting out the compiled output tostdout
. Or is this already possible, and I'm just not seeing how?