Render Mustache templates with a JSON at input. This tool was created with a purpose to use it in bash scripts.
You can download pre-built binaries for OS X and Linux or compile mustached manually.
Install on Linux:
$ wget https://github.com/vdemedes/mustached/raw/master/bin/mustached-linux-x64 -O mustached
$ chmod +x mustached
$ [sudo] mv mustached /usr/bin/mustached
Install on OS X:
$ wget https://github.com/vdemedes/mustached/raw/master/bin/mustached-darwin-x64 -O mustached
$ chmod +x mustached
$ [sudo] mv mustached /usr/bin/mustached
Compile manually (requires Crystal):
$ git clone https://github.com/vdemedes/mustached.git
$ cd mustached
$ crystal deps
$ make release
hello.mustache:
Hello {{ name }}
data.json:
{
"name": "Vadim"
}
$ cat data.json | mustached -t hello.mustache
or alternatively:
$ mustached -t hello.mustache -f data.json
MIT © Vadym Demedes