hbs-extract
Install
npm install -g hbs-extract
Usage
Usage: hbs-extract [options] <hbs_template, default value: "index.hbs">
Options:
-h, --help output usage information
-o, --output [filename] output result to a json file.
-V, --version output the version number
Example
{{title}} {{body}} {{#each people}} name:{{name}} Works: {{#each work}} {{content}} {{/each}} {{mycar.title}} {{/each}} {{footer.content}}
Result
API
hbs_extract.fromFile(hbs_file)
-hbs_file: path to hbs file
return a promise
hbs_extract;
hbs_extract.raw(hbs_content)
-hbs_content: string
return data
var data = hbs_extract;