json
安装
npm install json -g
使用
# 标准输入
<something generating JSON on stdout> | json [OPTIONS] [LOOKUPS...]
# 从文件中加载
json -f FILE [OPTIONS] [LOOKUPS...]
-e:修改
$ echo '{"name":"trent","age":38}' | json -e 'this.age++' { "name": "trent", "age": 39 } $json -I -f tmp.json -e 'this.deploy.type="git"'
-c:添加
json -I -f tmp.json -c 'this.deploy.branch="main"'
相关文章