All Projects → TylerBrock → Colorjson

TylerBrock / Colorjson

Licence: mit
Fast Color JSON Marshaller + Pretty Printer for Golang

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Colorjson

Pretty Print Json
🦋 Pretty-print JSON data into HTML to indent and colorize (written in TypeScript)
Stars: ✭ 41 (-42.25%)
Mutual labels:  pretty-print, json, color
Jsome
✨ Make your JSON look AWESOME
Stars: ✭ 179 (+152.11%)
Mutual labels:  json, color
Prettier Package Json
Prettier formatter for package.json files
Stars: ✭ 86 (+21.13%)
Mutual labels:  pretty-print, json
Zoya
Truly highly composable logging utility
Stars: ✭ 116 (+63.38%)
Mutual labels:  json, color
Tslog
📝 tslog - Expressive TypeScript Logger for Node.js.
Stars: ✭ 321 (+352.11%)
Mutual labels:  pretty-print, json
Tomlplusplus
Header-only TOML config file parser and serializer for C++17 (and later!).
Stars: ✭ 403 (+467.61%)
Mutual labels:  json, no-dependencies
Leetheme
优雅的主题管理库- 一行代码完成多样式切换
Stars: ✭ 762 (+973.24%)
Mutual labels:  json, color
Saw
Fast, multi-purpose tool for AWS CloudWatch Logs
Stars: ✭ 1,071 (+1408.45%)
Mutual labels:  json, color
Drop
A small CSS component that turns browser-native <details> elements into dropdown menus.
Stars: ✭ 69 (-2.82%)
Mutual labels:  no-dependencies
Fipe Json
🚘 FIPE API - Listagem com preço médio de veículos: carro, moto e caminhão.
Stars: ✭ 71 (+0%)
Mutual labels:  json
Fastjson
Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection
Stars: ✭ 1,164 (+1539.44%)
Mutual labels:  json
Perfect Dark Mode
🌚🌝 Perfect Dark Mode
Stars: ✭ 70 (-1.41%)
Mutual labels:  color
Metajson
Non-intrusive, high performance C++17 lightweight JSON de/serializer
Stars: ✭ 71 (+0%)
Mutual labels:  json
Jquery Jsontotable
This plugin can convert JSON data type to table for html. JSON is used primarily to transmit data between a server and web application, as an alternative to XML. In these reasons todays many applications use json data format for data transferring. And you need json to table converter for html display.
Stars: ✭ 69 (-2.82%)
Mutual labels:  json
Ducky
Duck-Typed Value Handling for JavaScript
Stars: ✭ 71 (+0%)
Mutual labels:  json
Sjson
Set JSON values very quickly in Go
Stars: ✭ 1,163 (+1538.03%)
Mutual labels:  json
Json Rules Engine
A rules engine expressed in JSON
Stars: ✭ 1,159 (+1532.39%)
Mutual labels:  json
Jason
A blazing fast JSON parser and generator in pure Elixir.
Stars: ✭ 1,174 (+1553.52%)
Mutual labels:  json
Rest
☕ REST: Yoctoframework — https://rest.n2o.dev
Stars: ✭ 71 (+0%)
Mutual labels:  json
Zio Tls Http
100% non-blocking, Java NIO only( inspired by zio-nio) , JSON HTTP server based on Scala ZIO library. Everything including TLS encryption modeled as ZIO effects, convenient route DSL similar to https4s, up to 30K TPS local JSON transaction with 25 threads on 6 cores(i7) with ZIO fibers.
Stars: ✭ 71 (+0%)
Mutual labels:  json

ColorJSON: The Fast Color JSON Marshaller for Go

ColorJSON Output What is this?

This package is based heavily on hokaccha/go-prettyjson but has some noticible differences:

  • Over twice as fast (recursive descent serialization uses buffer instead of string concatenation)
    BenchmarkColorJSONMarshall-4     500000      2498 ns/op
    BenchmarkPrettyJSON-4            200000      6145 ns/op
    
  • more customizable (ability to have zero indent, print raw json strings, etc...)
  • better defaults (less bold colors)

ColorJSON was built in order to produce fast beautiful colorized JSON output for Saw.

Installation

go get -u github.com/TylerBrock/colorjson

Usage

Setup

import "github.com/TylerBrock/colorjson"

str := `{
  "str": "foo",
  "num": 100,
  "bool": false,
  "null": null,
  "array": ["foo", "bar", "baz"],
  "obj": { "a": 1, "b": 2 }
}`

// Create an intersting JSON object to marshal in a pretty format
var obj map[string]interface{}
json.Unmarshal([]byte(str), &obj)

Vanilla Usage

s, _ := colorjson.Marshal(obj)
fmt.Println(string(s))

Customization (Custom Indent)

f := colorjson.NewFormatter()
f.Indent = 2

s, _ := f.Marshal(v)
fmt.Println(string(s))
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].