Description
The library provides a JSONC (json with comments) to JSON streamer. It supports multiline comments ( /* Comment */) and one-line comments ( // Comment ).
JSONcJSON alternatives and similar packages
Based on the "JSON" category.
Alternatively, view JSONcJSON alternatives based on common mentions on social networks and blogs.
-
fastjson
Fast JSON parser and validator for Go. No custom structs, no code generation, no reflection -
trdsql
CLI tool that can execute SQL queries on CSV, LTSV, JSON, YAML and TBLN. Can output to various formats. -
marshmallow
Marshmallow provides a flexible and performant JSON unmarshalling in Go. It specializes in dealing with unstructured struct - when some fields are known and some aren't, with zero performance overhead nor extra coding needed. -
epoch
Contains primitives for marshaling/unmarshaling Unix timestamp/epoch to/from built-in time.Time type in JSON -
jsonhandlers
JSON library to expose simple handlers that lets you easily read and write json from various sources.
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of JSONcJSON or a related project?
Popular Comparisons
README
JSONcJSON
The library provides a JSONC (json with comments) to JSON streamer. It
supports multiline comments ( /* Comment */
) and one-line comments
( // Comment
).
For example, it translates JSON with comments:
{
/*
JSONcJSON
=^._.^= ∫
*/
"Hello": "world" // In-line comments are also supported.
}
to a valid JSON:
{
"Hello": "world"
}
Installing:
go get github.com/hedhyw/jsoncjson
Usage example:
More [examples](./example_test.go).
// Converting jsonc to json and decoding.
const in = `
{
"Hello": "world"
/* Perhaps the truth depends on a walk around the lake. */
}
`
// The reader can be anything.
// For example: file, strings.NewReader(), bytes.NewReader(), ...
var r = jsoncjson.NewReader(strings.NewReader(in))
var data map[string]interface{}
_, = json.NewDecoder(r).Decode(&data)
fmt.Printf("%+v\n", data) // map[Hello:world].