Geni
Generator based in templates and json data.
Geni Sample
Usage
Programatic:
npm install geni --save
Example
const Geni = require('geni');
var geni = new Geni();
var options = {
result: "./results/result.txt",
template: {
isPath: true,
body: "./template/template.txt"
},
data: "./data/data.json"
};
geni.generate(options);
var options = {
template: {
isPath: false,
body: "my data @@key"
},
data: [
{ key: "123" },
{ key: "321" },
]
};
var result = geni.generate(options);
key: @@key
[
{ "key": "value1" },
{ "key": "value2" },
{ "key": "value3" }
]
then run:
node my-generator.js
key: value1
key: value2
key: value3