Skip to content
No description or website provided.
Find file
Pull request Compare This branch is 92 commits behind dominictarr:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bin
test
.gitignore
all-tests.sh
errlog
outlog
package.json
parse.sh
readme.markdown

readme.markdown

JSON.sh

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.

$ cat package.json | json_parse
["name"]    "JSON.sh"
["version"] "0.0.0"
["description"] ""
["homepage"]    "http://github.com/dominictarr/JSON-sh"
["repository","type"]   "git"
["repository","url"]    "https://github.com/dominictarr/JSON-sh.git"
["repository"]  {"type":"git","url":"https://github.com/dominictarr/JSON-sh.git"}
["bin","json_parse"]    "./bin/json_parse"
["bin"] {"json_parse":"./bin/json_parse"}
["dependencies"]    {}
#  ... etc

a more complex example:

curl registry.npmjs.org/express | ./bin/json_parse | egrep '\["versions","[^"]*"\]'
... try it and see
Something went wrong with that request. Please try again.