json

本文最后更新于:2023年12月5日 晚上

安装

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"'

json
http://blog.lujinkai.cn/前端/node/node/
作者
像方便面一样的男子
发布于
2021年3月15日
更新于
2023年12月5日
许可协议