Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/abrander/colorjson

JSON encoder featuring color output for terminals
https://github.com/abrander/colorjson

Last synced: about 1 month ago
JSON representation

JSON encoder featuring color output for terminals

Awesome Lists containing this project

README

        

# (Yet Another) colorjson

colorjson is a package for formatting and colorizing JSON output
for the terminal.

Performance is not a priority of this package. It's intended
to be used for low traffic output for human consumption.

## Usage

```bash
go get github.com/abrander/colorjson
```

```go
package main

import (
"os"

"github.com/abrander/colorjson"
)

func main() {
data := struct {
Name string
Age int
}{
Name: "John Doe",
Age: 42,
}

encoder := colorjson.NewEncoder(os.Stdout, colorjson.Default)
encoder.Encode(data)
}
```