1.0.0 • Published 8 years ago
json-filter-cli v1.0.0
Json Filter (CLI)
Simple console utility that takes JSON file and removes some properties from main object.
Installation
npm i -g json-filter-cliUsage
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=2you will get output.json that contains:
{
"a": 1,
"b": 2
}Options
- If no
--fromargument specified error will be returned. - If
--onlyarguments present, all properties except specified as arguments will be removed. - If
--exceptarguments present, all properties that specified as arguments will be removed. - If
--toargument specified output will be saved in specified path. If no--toargument present input file will be overwritten. --space- see third argument of JSON.stringify function.
Authors
License
1.0.0
8 years ago