Wrote yet another JSON parser supporting comments, trailing commas, and multiline strings

This page summarizes the projects mentioned and recommended in the original post on /r/golang

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
  • jsonc

    Golang (v1.13+) JSON5 preprocessor supporting comments, trailing comma, unquoted key/single-quoted string, hex number, trailing decimal point, literal newlines and more. (by adhocore)

    jsonc is a Golang package for parsing JSON data with comments- both single (//) and multiline (/* */). It also supports trailing commas at the end of array and object notations, and literal line feeds in string values.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • json5

    JSON5 — JSON for Humans

    json though ubiquitous message exchange format, is for the machines but less so for humans. So jsonc is a little attempt to improve a bit: eg- with comments it would be possible to neatly annotate the data, trailing commas allow for proper diff on json config files and literal multiline strings greatly facilities breaking a super long line. I plan to implement most of [JSON5](https://json5.org] spec over time specifically object keys without wrapping quotes and string values with single quotes. Feedbacks welcome.

  • rjson

    "readable JSON" - JSON-compatible codec with a few tweaks to make it quicker to write and easier to read (by rogpeppe)

    Requiring users to fully load in all JSON as a []byte or a string is a big kick in the teeth. You ought to be able to stream it through an io.Reader. You should either implement your code as an io.Reader wrapper, or go ahead and just fork encoding/json (or some other JSON library) to implement your changes, like this one did.

  • go-jsoncommentstrip

    Library for strip JSON comments

    As others have said, there's a ton of variations on this theme already on GitHub. You are welcome to write whatever code you want of course, but if it is a problem for you that this market is already saturated, well, do what you need to with that information. This is an example of an io.Reader wrapper. Though there is a performance case to be made for integrating it into a fork of a normal library, because a reader wrapper must parse the JSON, then the decoder has to parse the JSON. The wrapper can parse it "less" but it still has to run a state machine through it. Integrating it into the decoder means the parsing can be done once.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Using ARG in a Dockerfile – beware the gotcha

    3 projects | news.ycombinator.com | 14 May 2024
  • JSON5 – JSON for Humans

    1 project | news.ycombinator.com | 3 Mar 2024
  • 🚀 'GET' API in API Maker

    1 project | dev.to | 17 Aug 2023
  • TySON: a native go library that lets you use TypeScript as an embedded configuration language without depending on Node or V8

    5 projects | /r/golang | 6 Jul 2023
  • is there a reason JXON.ahk accepts only Maps and not Class Objects?

    2 projects | /r/AutoHotkey | 21 Jun 2023

Did you konow that Go is
the 4th most popular programming language
based on number of metions?