项目作者: ORESoftware

项目描述 :
Modify .json files using shell tools.
高级语言: JavaScript
项目地址: git://github.com/ORESoftware/modify.json.git
创建时间: 2018-05-17T02:15:39Z
项目社区:https://github.com/ORESoftware/modify.json

开源协议:MIT License

下载


@oresoftware/modify.json

This is a command line tool to modify subproperties on disk or write to stdout.

install: npm install -g @oresoftware/modify.json

Usage

modify.json ‘the.nested.prop.you.want.to.modify’

By default this writes the JSON.stringify result to stdout. To modify the file on disk, use:

  1. --disk

To change the value to a boolean, use:

  1. modify.json <file> <prop> true
  2. modify.json <file> <prop> 'true'
  3. modify.json <file> <prop> false
  4. modify.json <file> <prop> "false"

To change the value to an empty string, use:

  1. modify.json <file> <prop> '""'

To change to the string “true”

  1. modify.json <file> <prop> '"true"'