json-filter-cli

1.0.0 • Public • Published

Json Filter (CLI)

Simple console utility that takes JSON file and removes some properties from main object.

Installation

npm i -g json-filter-cli

Usage

For example, you have input.json:

{
  "a": 1,
  "b": 2,
  "c": 3
}

then, when you run

json-filter --from=input.json --to=output.json --only=a --only=b --space=2

you will get output.json that contains:

{
  "a": 1,
  "b": 2
}

Options

  • If no --from argument specified error will be returned.
  • If --only arguments present, all properties except specified as arguments will be removed.
  • If --except arguments present, all properties that specified as arguments will be removed.
  • If --to argument specified output will be saved in specified path. If no --to argument present input file will be overwritten.
  • --space - see third argument of JSON.stringify function.

Authors

License

MIT

/json-filter-cli/

    Package Sidebar

    Install

    npm i json-filter-cli

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    7.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • horat1us