plugin based generator
$ npm install tsukurite/templawrite 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-nameexecute templa.
$ ./node_modules/.bin/templa ./index.json
Hi, Alice!
Hi, Bob!configsObject[]- configs for template plugins
dirString- change require directory
returnString[]- template plugin values
configsObject[]- configs for template plugins
dirString- change require directory
returnString- 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 testThe MIT license. Please see LICENSE file.