json-batch-extend
v1.0.0
Published
Extend a json template with json objects in a parameters directory, and create an output for each parameter object.
Downloads
3
Readme
JSON templating
Create a template file json file, example:
template.json
{
"field1": "value1",
"field2": "value2",
"field3": "value3"
}
Create a parameters directory with parameter json files, example:
params/p1.json
{
"field2": "other value 1"
}
params/p2.json
{
"field2": "other value 2"
}
Create the output directory, example:
mkdir out
Run the program:
npm start template.json params out
This will combine the template with the parameters and save an output file for each parameter file. The output directory will contain:
out/p1.json
{
"field1": "value1",
"field2": "other value 1",
"field3": "value3"
}
out/p2.json
{
"field1": "value1",
"field2": "other value 2",
"field3": "value3"
}