Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (26 sloc) 939 Bytes

yo, so it's a json parser written in bash

pipe json to it, and it traverses the json objects and prints out the path to the current object (as a JSON array) and then the object, without whitespace.

$ json_parse < package.json
["name"]    ""
["version"] "0.0.0"
["description"] ""
["homepage"]    ""
["repository","type"]   "git"
["repository","url"]    ""
["repository"]  {"type":"git","url":""}
["bin","json_parse"]    "./bin/json_parse"
["bin"] {"json_parse":"./bin/json_parse"}
["dependencies"]    {}
#  ... etc

a more complex example:

curl | ./bin/json_parse | egrep '\["versions","[^"]*"\]'
... try it and see


If you have any examples with, streaming twitter, github, or whatever! please issue a pull request and i will include them.