1.0.1 • Published 4 years ago

json-cfg-cli v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
4 years ago

json-cfg-cli

  • cli tool for big-json-config

install

  • npm install json-cfg-cli -g

usage

srchk

@#jcfg_srchk --src ./angular.json --srchk /config/g --path projects proj architect e2e
["projects"]["proj"]["architect"]["e2e"]["configurations"]["production"]["devServerTarget"]
    proj:serve:production
---
@#


Options:
  -V, --version      output the version number
  --src <src>        source file path[mandatory:such,as a/b/c]
  --path [path...]   json key path splitted-by-space,used with --srch* (default: [])
  --srchk <pattern>  search in json config with pattern[string or regexp],only search key path
  -h, --help         display help for command
@#

srchv

@#jcfg_srchv --src ./angular.json --srchv /lin/g --path projects proj
["projects"]["proj"]["architect"]["lint"]["builder"]
    @angular-devkit/build-angular:tslint
---
@#
@#
@#
@#
@#jcfg_srchv -h
Usage: jcfg_srchv [options]

Options:
  -V, --version      output the version number
  --src <src>        source file path[mandatory:such,as a/b/c]
  --path [path...]   json key path splitted-by-space,used with --srch* (default: [])
  --srchv <pattern>  search in json config with pattern[string or regexp],only search value
  -h, --help         display help for command
@#

srchkv

@#jcfg_srchkv -h
Usage: jcfg_srchkv [options]

Options:
  -V, --version       output the version number
  --src <src>         source file path[mandatory:such,as a/b/c]
  --path [path...]    json key path splitted-by-space,used with --srch* (default: [])
  --srchkv <pattern>  search in json config,with pattern[string or regexp],only search value
  -h, --help          display help for command
@#
@#
@#
@#jcfg_srchkv --src ./angular.json --srchkv /lin/g --path projects proj
["projects"]["proj"]["architect"]["lint"]["builder"]
    @angular-devkit/build-angular:tslint
---
["projects"]["proj"]["architect"]["lint"]["options"]["tsConfig"][0]
    tsconfig.app.json
---
["projects"]["proj"]["architect"]["lint"]["options"]["tsConfig"][1]
    tsconfig.spec.json
---
["projects"]["proj"]["architect"]["lint"]["options"]["tsConfig"][2]
    e2e/tsconfig.json
---
["projects"]["proj"]["architect"]["lint"]["options"]["exclude"][0]
    **/node_modules/**
---
@#

prompt

@#jcfg_prompt --src ./angular.json --path projects proj archit
path:[ projects proj archit ] :
childrens:
[ 'architect' ]
@#
@#jcfg_prompt --src ./angular.json --path projects proj architect
path:[ projects proj architect ] :
childrens:
[ 'build', 'serve', 'extract-i18n', 'test', 'lint', 'e2e' ]
@#jcfg_prompt --src ./angular.json --path projects proj architect build
path:[ projects proj architect build ] :
childrens:
[ 'builder', 'options', 'configurations' ]
@#jcfg_prompt --src ./angular.json --path projects proj architect build builder
path:[ projects proj architect build builder ] :
    <@angular-devkit/build-angular:browser>
@#


@#jcfg_prompt -h
Usage: jcfg_prompt [options]

Options:
  -V, --version     output the version number
  --src <src>       source file path[mandatory:such,as a/b/c]
  --path [path...]  for nest-layer hint with path (default: [])
  -h, --help        display help for command
@#

set

@#jcfg_prompt --src ./angular.json --path projects proj architect build options assets '0'
path:[ projects proj architect build options assets 0 ] :
    <src/favicon.ico>
@#
@#
@#jcfg_set --src ./angular.json --set projects proj architect build options assets '0' --val src/favicon-tst.ico
the value of:
    path:[ projects proj architect build options assets 0 ]
    changed to <src/favicon-tst.ico>
{
  '$schema': './node_modules/@angular/cli/lib/config/schema.json',
  version: 1,
  newProjectRoot: 'projects',
  projects: {
    proj: {
      projectType: 'application',
      schematics: {},
      root: '',
      sourceRoot: 'src',
      prefix: 'app',
      architect: [Object]
    },
    'nest-menu': {
      projectType: 'library',
      root: 'projects/nest-menu',
      sourceRoot: 'projects/nest-menu/src',
      prefix: 'nv',
      architect: [Object]
    }
  },
  defaultProject: 'proj',
  x: { t: {} },
  pro: ''
}
@#
@#
@#jcfg_set -h
Usage: jcfg_set [options]

Options:
  -V, --version    output the version number
  --src <src>      source file path[mandatory:such,as a/b/c]
  --set <path...>  set value with path
  --val <value>    value for --set
  -h, --help       display help for command
@#

rm

@#jcfg_rm -h
Usage: jcfg_rm [options]

Options:
  -V, --version   output the version number
  --src <src>     source file path[mandatory:such,as a/b/c]
  --rm <path...>  set value with path
  -h, --help      display help for command
@#

LICENSE

  • ISC