Makes json all pretty-like.
Installation requires conscript
cs xuwei-k/pj
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
libraryDependencies += "com.github.xuwei-k" %% "pj" % "0.1.1"
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), Kenji Yoshida (xuwei-k) 2012 -