JS>> je>> 返回
项目作者: wooos

项目描述 :
Stream editor for json
高级语言: Go
项目地址: git://github.com/wooos/je.git
创建时间: 2020-11-11T01:57:53Z
项目社区:https://github.com/wooos/je

开源协议:Apache License 2.0

下载


je

CircleCI

Command line editor for json.

Usage

  1. Command line editor for json.
  2. Usage
  3. je [command]
  4. Available Commands:
  5. completion Generate auto completions script for goe for the specified shell (bash)
  6. delete Delete the keys of json
  7. help Help about any command
  8. update update a json file
  9. version print current version information
  10. Flags:
  11. -h, --help help for je
  12. Use "je [command] --help" for more information about a command.

Example

The below is content of source.json.

  1. {
  2. "name": "je",
  3. "version": "v1.0",
  4. "detail": {
  5. "n": "je",
  6. "v": "v1.0"
  7. },
  8. "users": [
  9. "a",
  10. "b"
  11. ]
  12. }
  1. modify name value je to jee
  1. $ je update --set name=jee source.json
  1. modify detail.n value je to jee
  1. $ je update --set detail.n=jee source.json
  1. modify users values a to aa
  1. $ je update --set users[0]=aa source.json
  1. modify name value je to jee and modify n value je to jee
  1. $ je update --set name=jee,detail.n=jee source.json
  1. delete key name
  1. $ je delete --keys name source.json
  1. delete key detail.n
  1. $ je delete --keys detail.n source.json