jsonf

command module
v0.0.0-...-a3217d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 13, 2020 License: Zlib Imports: 6 Imported by: 0

README

Console JSON formatter with query feature.

Install:

$ go get github.com/miolini/jsonf

Usage:

Usage of jsonf:
  -c=true: colorize output
  -d=false: debug output to stderr
  -f=true: format output json to stdout
  -q="": json query
  -s=true: syntax hightlight
  -v=false: verbose output to stderr

Examples:

$ echo '{"uid":1,"email":"user@gmail.com","address":{"city":"New-York","country":"US"}}' | jsonf

Output

$ echo '{"uid":1,"email":"user@gmail.com","address":{"city":"New-York","country":"US"}}' \
  | jsonf -q 'value["address"]["country"]'
"US"

Using from another Golang program

import (
  ...
  "github.com/miolini/jsonf/jsonflib"
  ...
)
...
    jsonRaw, err := jsonflib.Highlight(
      jsonRaw,
      jsonflib.HighlightFlags{Colorize: true, Verbose: false, Debug: false},
    )
    if err != nil {
      return err
    }

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL