Heinzelmannchen is a little helper for your daily work. It is used to create code from your templates. This module acts as a facade for the underlying heinzelmannchen functionality, exposing an easy to use promise based API. If you like to use Heinzelmannchen in your workflow checkout heinzelmannchen-cli.
Usage as a node module
var heinzel = ; //1. check local installed templatesheinzel ; //2. explore installable templates, it searches in npm, automatically adding the corresponding prefix 'heinzelmannchen-tpl-'heinzel ; //if your template doesn't use standard heinzelmannchen prefixes, use:heinzel ; //3. install desired templateheinzel ; //4. check local installed generatorsheinzel ; //5. explore installable generators. As you can guess, it also searches in npm with following prefix: 'heinzelmannchen-gen-'heinzel ; //6. install your generatorheinzel ;
After installing you need to link the templates to their corresponding generators, here's an example (See Wiki for explanations):
{
"domains": {
"extViews": {
"formView": {
"template": "heinzelmannchen-template/examples/tableTemplate.tpl",
"generator": {
"name": "heinzelmannchen-gen-pg",
"config": {
"database": "heinzel"
}
}
},
"output": "./foo/bar/<%= table_name %>.md"
}
},
"generators": {
"heinzelmannchen-gen-pg": {
"npm": "heinzelmannchen-gen-pg",
"config": {
"charset": "utf8",
"host": "127.0.0.1",
"password": "password",
"user": "user"
}
}
},
"templates": {
"formView": "http://yourrepo.com/formView.git#1.0.1",
"foobar": "http://yourrepo.com/formView.git#1.0.1"
}
}
now you can generate
//7. run your generators, as defined in your configvar heinzel = ; heinzel;