yves-cli

CLI JSON inspector with jorisroling/yves.js

Usage no npm install needed!

<script type="module">
  import yvesCli from 'https://cdn.skypack.dev/yves-cli';
</script>

README

yves-cli

CLI JSON inspector with yves from Joris Röling. Pretty colors!

Install

$ npm install -g yves-cli

Usage

$ yves --help
Usage: yves [options] <file ...>

  Options:

    -h, --help             output usage information
    -V, --version          output the version number
    --no-pretty            no pretty formatting
    --no-color             no color
    -m, --max-length <n>   max length
    -r, --root <path>      set dot notated root field
    -f, --fields <fields>  comma separated fields
    -q, --query <expr>     query data with expr (ala mongo)
    -h, --help             output usage information    

Examples

Sources

From file:

$ ls
package.json component.json

$ yves package.json

Or many files:

$ ls
package.json component.json

$ yves package.json component.json

Pipe from any source:

$ curl -s "https://api.github.com/users/jorisroling" | yves
$ echo '{"foo": {"bar": 0}}' | yves 
{
    foo: { bar: 0 }
}