handlebarizer
Solution for compiling handlebars templates into vanilla JS functions for client-side use. Inspired by HenrikJoreteg/templatizer
example
template.hbs:
<div>{{name}}</div>
template.hbs.js:
module { helpers = helpers || Handlebarshelpers; var buffer = "" stack1 foundHelper functionType = "function" escapeExpression = thisescapeExpression; buffer += "<div>"; foundHelper = helpersname; if foundHelper stack1 = foundHelper; else stack1 = depth0name; stack1 = typeof stack1 === functionType ? : stack1; buffer += + "</div>"; return buffer;};
Then the template can be used:
var handlebars = var template = handlebarsvar html =
install
npm install [-g] handlebarizer
api
var handlebarizer =
cli
Usage: handlebarizer [options] [command] Commands: compile <path> Options: -h, --help output usage information -V, --version output the version number -r, --recursive recursively compile throughout the directory tree
license
MIT