heinzelmannchen-template
heinzel-template is part of heinzelmannchen. It is a CLI- and node tool to process template files. It uses underscore as the templateeninge of choice.
Usage
CLI
Usage: heinzel-template -t [template] -j [dataFile]
Options:
-h, --help output usage information
-t, --template [value] the template
-j, --json [value] a json-file containing the data
-s, --script [value] load a custom js-script, to use in a templat under the global _custom
-o, --output [value] output filename
-e, --encoding [value] encoding of the files
-s, --silent no console output
-f, --force create folders if not existing
-d, --dry-run don't create files
-D, --debug print error object
-T, --trace print stacktrace
-V, --version output the version number
Node module
var ht = ; // 1. passing filesht ; // 2. passing json dataht ; // 3. processing a stringht ;
Template
The templateengine under the hood is underscorejs. By default it uses ERB-style. Additional to the functionality provided by undescorejs you can use underscorejs.string or load your own module, which will be available under "_custom".