Skip to content
/ pj Public
forked from softprops/pj

a pajama party for your json strings and streamers

License

Notifications You must be signed in to change notification settings

agustafson/pj

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pj

Makes json all pretty-like.

as a conscript app

install

Installation requires conscript

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-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

About

a pajama party for your json strings and streamers

Resources

License

Stars

Watchers

Forks

Packages

No packages published