• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

dominictarr/JSON.sh: a pipeable JSON parser written in Bash

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

dominictarr/JSON.sh

开源软件地址:

https://github.com/dominictarr/JSON.sh

开源编程语言:

Shell 90.7%

开源软件介绍:

JSON.sh

yo, so it's a json parser written in shell, compatible with ash, bash, dash and zsh

travis

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"]  "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"]  "./JSON.sh"
["bin"]  {"json_parse":"./JSON.sh"}
["dependencies"]  {}
#  ... etc

a more complex example:

curl registry.npmjs.org/express | ./JSON.sh | egrep '\["versions","[^"]*"\]'
... try it and see

Options

-b

Brief output. Combines 'Leaf only' and 'Prune empty' options.

-l

Leaf only. Only show leaf nodes, which stops data duplication.

-p

Prune empty. Exclude fields with empty values.

-n

No-head. Don't show nodes that have no path. Normally these output a leading '[]', which you can't use in a bash array.

-s

Remove escaping of the solidus symbol (stright slash).

-h

Show help text.

Cool Links

Installation

Install with npm, pip or from AUR on Archlinux:

  • npm install -g JSON.sh
  • pip install git+https://github.com/dominictarr/JSON.sh#egg=JSON.sh
  • yaourt -Sy json-sh (json-sh on aur thanks to kremlin-)

License

This software is available under the following licenses:

  • MIT
  • Apache 2



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
tymondesigns/jwt-auth: 发布时间:2022-07-08
下一篇:
kubernetes-retired/kubernetes-anywhere: [EOL] {concise,reliable,cross-platform} ...发布时间:2022-07-09
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap