plugin based generator
$ npm install tsukurite/templa
write index.json
for output config.
[
{
"name": "hello-to-the-name",
"data": {
"name": "Alice"
}
},
{
"name": "hello-to-the-name",
"data": {
"name": "Bob"
}
}
]
install plugin modules.
$ npm install ./templa-te-hello-to-the-name
execute templa
.
$ ./node_modules/.bin/templa ./index.json
Hi, Alice!
Hi, Bob!
configs
Object[]
- configs for template plugins
dir
String
- change require directory
return
String[]
- template plugin values
configs
Object[]
- configs for template plugins
dir
String
- change require directory
return
String
- template plugin value
write package.json
and index.js
.
{
"name": "templa-te-hello-to-the-name",
"version": "0.0.0",
"main": "./index.js",
"private": true
}
module.exports = function(data) {
return 'Hi, ' + data.name + '!\n';
};
$ npm install
$ npm run build
$ npm test
The MIT license. Please see LICENSE file.