Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use handlebars from shell?

I know how to use handlebars from java, but if I'd like to register some extensions, and compile some template to generate file with some testing data. npm install -g handlebars gives me some command to precompile templates, but I cannot find anything to evaluate that templates. I found only some very old unmaintained tool, but is there some correct way, up to date, official?

like image 626
Martin Mucha Avatar asked Sep 17 '25 20:09

Martin Mucha


1 Answers

Ok, I still don't know if it's the OK way, but after a lot of search, I found hbs-cli tool(https://github.com/keithamus/hbs-cli). So usage could be

Install:

npm install -g hbs-cli

invocation:

hbs --data <(echo '{"who":"world"}') <(echo 'Hello {{who}}!') --stdout

like image 130
Martin Mucha Avatar answered Sep 21 '25 18:09

Martin Mucha