Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/calvinlfer/fill-in-the-blanks

A very simple command line tool that takes opinionated template files and data and generates an output file
https://github.com/calvinlfer/fill-in-the-blanks

Last synced: 4 days ago
JSON representation

A very simple command line tool that takes opinionated template files and data and generates an output file

Awesome Lists containing this project

README

        

# Fill-In-The-Blanks (F.I.T.B.)
The F.I.T.B. is to take opinionated templated JSON files and JSON data
and then produces output by filling in the placeholders with data.

## Installation
`npm install -g fill-in-the-blanks`

## Usage
`fill-in-the-blanks `

## Example
Templated file with placeholders
backup-template.json
```json
{
"exampleField": "{{=param.fieldA}}",
"sevenFold": "{{=param.fieldB}}",
"normal": "just some data"
}
```

Data file
data.json
```
{
"fieldA": "valueForFieldA",
"fieldB": "anotherValueForFieldB"
}
```

Executing `fill-in-the-blanks backup-template.json data.json output.json`
will produce:

Output file
output.json
```
{
"exampleField": "valueForFieldA",
"sevenFold": "anotherValueForFieldB",
"normal": "just some data"
}
```