Skip to content

dana/JSON.sh

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

a pipeable JSON parser written in Bash

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published