Need help with hujson?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

tailscale
159 Stars 6 Forks BSD 3-Clause "New" or "Revised" License 9 Commits 3 Opened issues

Description

HuJSON: JSON for Humans (comments and trailing commas)

Services available

!
?

Need anything else?

Contributors list

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.