A short, simple tool to convert YAML to JSON as long as it's representable.
go get github.com/echojc/y2j
If a file is provided, convert that file:
$ echo 'abc: 1' > /tmp/a
$ y2j /tmp/a
{"abc":1}
Otherwise, read from stdin:
$ y2j <<.
abc:
- 1
- bar: 2
quux: 3
.
{"abc":[1,{"bar":2,"quux":3}]}
This project depends on go-yaml.
$ go get gopkg.in/yaml.v2
$ go build