https://github.com/sjmulder/json-yaml
Convert JSON to YAML and back
https://github.com/sjmulder/json-yaml
cli json textproc unix yaml
Last synced: 11 months ago
JSON representation
Convert JSON to YAML and back
- Host: GitHub
- URL: https://github.com/sjmulder/json-yaml
- Owner: sjmulder
- License: bsd-2-clause
- Created: 2018-07-30T09:41:43.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-29T21:26:33.000Z (almost 5 years ago)
- Last Synced: 2025-07-28T06:03:11.671Z (11 months ago)
- Topics: cli, json, textproc, unix, yaml
- Language: C
- Homepage:
- Size: 32.2 KB
- Stars: 11
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.md
Awesome Lists containing this project
README
json-yaml
=========
[](
https://builds.sr.ht/~sjmulder/json-yaml)
**json-yaml** [_file_]
**yaml-json** [_file_]
Convert JSON to YAML or back. Uses standard input if no filename is supplied.
Examples
--------
`$ 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
[...]
`$ yaml-json sample.yaml`
{
"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"
},
[...]
`$ 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: []
Installation
------------
Dependencies:
* [libyaml](http://pyyaml.org/wiki/LibYAML)
* [yajl](https://lloyd.github.io/yajl/)
From souce, after tweaking the Makefile to taste:
make
make check
make install [DESTDIR=] [PREFIX=/usr/local]
To uninstall:
make uninstall [DESTDIR=] [PREFIX=/usr/local]
Authors
-------
Sijmen Mulder ()