json format processing tools

json format processing tools

JSON-line processing tool for quick command, not simply rely on.

I am here are some of the most common:

  • Prints formatted data debug http request
  • Formatting data stream or a local or
  • Json acquired key or execution, calculation

A simple example

$ echo '{"foo":"bar"}' | json # 格式化
{
  "foo": "bar"
}

$ echo '{"foo":"bar"}' | json foo # json 中取值
bar

$ echo '{"fred":{"age":42}}' | json fred.age # 深层对象取值
42

$ echo '{"age":10}' | json -e 'this.age++' # 取值计算
{
  "age": 11
}

Imagine give you a back end api, you just want to look at the contents, the results looked surprised, as if you gibberish scared rash.

Fortunately, you have a json artifacts, plus a |jsonperfect solution.

Before using Artifact

After using Artifact

 

Artifact direct

Project Home:  https://github.com/trentm/json
use the document:  http://trentm.com/json

Article Source

Note: This article comes from the public micro-channel number [Music Library] play nodejs npm tool.

 

Guess you like

Origin www.cnblogs.com/daysme/p/11895557.html