Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/abrander/colorjson
- Owner: abrander
- License: mit
- Created: 2023-02-02T17:24:46.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-06-13T09:40:58.000Z (over 1 year ago)
- Last Synced: 2024-06-20T11:14:25.252Z (7 months ago)
- Language: Go
- Size: 14.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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 mainimport (
"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)
}
```