diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2016-03-25 23:01:49 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2016-03-25 23:06:31 -0400 |
| commit | 158995a0b79a957ac5b7dfe1777e3dc9c4458468 (patch) | |
| tree | 11b9a2b43688466a2649ddeda5eea9c5cf361e7d /README.md | |
| parent | 2a00d3e46287bc9fc810924f488dc5a7f03a27b0 (diff) | |
Adding json filter function
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -73,6 +73,23 @@ $ FOO=true gomplate < input.tmpl foo ``` +#### `json` + +Converts a JSON string into an object. Only works for JSON Objects. This can be used to access properties of JSON objects. + +##### Example + +_`input.tmpl`:_ +``` +Hello {{ (getenv "FOO" | json).hello }} +``` + +```console +$ export FOO='{"hello":"world"}' +$ gomplate < input.tmpl +Hello world +``` + ### Some more complex examples ##### Variable assignment and `if`/`else` |
