./json-yaml -h
Usage: json-yaml [OPTIONS] [FILE]
Convert JSON into YAML
Uses standard input if no filename is supplied.
Options:
-v, --version print version number and exit
-h, --help print this message and exit
./json-yaml sample.json
firstName: John
lastName: Smith
isAlive: true
age: 25
address:
streetAddress: 21 2nd Street
city: New York
state: NY
postalCode: 10021-3100
phoneNumbers:
- type: home
number: 212 555-1234
- type: office
number: 646 555-4567
- type: mobile
number: 123 456-7890
children: []
spouse: null
curl -s http://api.icndb.com/jokes/random | ./json-yaml
type: success
value:
id: 415
joke: When Chuck Norris wants an egg, he cracks open a chicken.
categories: []
On OS X, you can use Homebrew:
brew tap yokattana/tap
brew install json-yaml
For other platforms, consult the Building section below.
You need libyaml and yajl. Then:
make
Other targets:
make check
make install
make uninstall
See Makefile for variables.
Home page: https://github.com/yokattana/json-yaml
Builds: https://travis-ci.org/yokattana/json-yaml/