UNPKG

handlebars4code

Version:

library and NPM module that extends Handlebars with Helpers for Code Generation in a specific programming language (e.g. Javascript)

29 lines (21 loc) 534 B
### Helper: `` #### Template: `` Assume we have the following templates is stored `vDataJSON.tpl["mytpl"]` with: ```javascript ``` #### JSON Data: `` The following JSON is used the helper call: ```javascript var my_json = { "data": { "classname": "NewClass", "superclassname": "MySuperClass", }, "settings": { } }; ``` #### Compiler Output: `` The compiler call `Handlebars4Code.compile.mytpl2(my_json)` for the JSON data `my_json` and the template generates the following code: ```javascript ```