https://github.com/softprops/pj
a pajama party for your json strings and streamers
https://github.com/softprops/pj
Last synced: 8 months ago
JSON representation
a pajama party for your json strings and streamers
- Host: GitHub
- URL: https://github.com/softprops/pj
- Owner: softprops
- License: mit
- Created: 2012-01-21T19:02:59.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-06-11T13:21:56.000Z (about 13 years ago)
- Last Synced: 2024-05-09T09:41:22.995Z (about 2 years ago)
- Language: Scala
- Homepage:
- Size: 110 KB
- Stars: 5
- Watchers: 4
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pj
Makes json all pretty-like.
## as a conscript app
### install
Installation requires [conscript][cs]
cs softprops/pj
### usage
Formatting piped data with curl (discarding stderr), use empty `--` flag
curl 'http://api.tea.io/time' 2>/dev/null | pj --
{
"tea_time": true
}
Formatting json from file and writing to another.
pj -f path/to/in.json -o path/to/out.json
Formatting inline json
pj -j '{"oh":"la,la","datas":[1,2,3,4],"objects":{"waka":"waka"}}'
Getting help
pj -h
## as a library
### install
Install using [ls][ls]
ls-install pj
Install by hand
libraryDependencies += "me.lessis" %% "pj" % "0.1.0"
### usage
val raw = """{"oh":"la,la","datas":[1,2,3,4],"objects":{"waka":"waka"}}"""
println(pj.Printer(raw))
{
"oh" : "la,la",
"datas" : [ 1, 2, 3, 4 ],
"objects" : {
"waka" : "waka"
}
}
Doug Tangren (softprops) 2012
[cs]: https://github.com/n8han/conscript#readme
[ls]: http://ls.implicit.ly/