1.0.2 • Published 7 years ago

jsonscope v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

jsonscope

npm install -g jsonscope

Basic Usage

$ jsonscope -h
$ jsonscope <file>.json

Interface

<key>: Print the value of Object[key] within current object. If the type of

Object[key] is "object", then start interfacing with that object.

-h, --help: Print a help string at any point.

-kv: Print key, value pairs of current object. Only prints value of primitives.

-v, --values: Print values of current object.

-k, --keys: Print keys of current object.

-m, --map <property>: For all the values in the current object, replace them with value[property] and interface with it. Similar to ([...]).map(obj => obj["property"])

-mo, --mapOper, --mapOperation <operation>: Similar to map, except perform operation on the value. Mainly intended for squaring. Runs JavaScript's native eval, so can be used for logging Math.log(it), or squaring: *it.

-f, --filter <property>: Filters null values and if the property is passed values where that property is falsy. If no value is passed, then it removes all null values.

-r, --reduce <property>: Reduce by summing all values or if property is provided, reduce by ([...]).reduce((sum, next) => sum + next["property"], 0)

--sort: Sort ascending

--reverse: Reverse value order

--unique: Filters unique value

-?, --sample: Reads a random KV pair in the current object

--up, -u <# defaults 0>: Traces back # keys

--exit, -e: Exits the process

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago