Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 492 Bytes

README.md

File metadata and controls

24 lines (16 loc) · 492 Bytes

jsonhl

Go library to colorize JSON output of terminal applications.

Features

  • small and focused
  • colorizes JSON output without changing the JSON formatting

Usage

Using io.Reader and io.Writer:

jsonhl.Highlight(os.Stdin, os.Stdout)
jsonhl.HighlightC(os.Stdin, os.Stdout, jsonhl.DefaultColors)

Using strings:

fmt.Println(jsonhl.HighlightString(`{ "hello" : "world" }`))
fmt.Println(jsonhl.HighlightStringC(`{ "hello" : "world" }`, jsonhl.DefaultColors))