hujson

by tailscale

tailscale / hujson

HuJSON: JSON for Humans (comments and trailing commas)

150 Stars 6 Forks Last release: Not found BSD 3-Clause "New" or "Revised" License 9 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

HuJSON - Human JSON

The HuJSON decoder is a JSON decoder that also allows

  • comments, both
    /* ... */
    and
    // to end of line
  • trailing commas on arrays and object members

It is a soft fork of the Go standard library

encoding/json
package. The plan is to merge in all changes from each Go release.

Currently HuJSON is based on Go 1.13.

Grammar

The changes to the JSON grammar are:

--- grammar.json
+++ grammar.hujson
@@ -1,13 +1,31 @@
 members
    member
+   member ',' ws
    member ',' members

elements element

  • element ',' ws element ',' elements

+comments

  • "*/"
  • comment comments
  • comment
  • '0000' . '10FFFF'
  • linecomments
  • '\n'
  • linecomment
  • linecomment
  • '0000' . '10FFFF' - '\n'
  • ws ""
  • "/*" comments
  • "//" linecomments '0020' ws '000A' ws '000D' ws

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.