tailscale/hujson

HuJSON: JSON for Humans (JWCC: JSON w/ comments and trailing commas)

Go

873

39 commits

updated Jul 27, 2026

See the code

README

HuJSON - "Human JSON" (JWCC)

Go Reference

The github.com/tailscale/hujson package implements the JWCC extension of standard JSON.

The JWCC format permits two things over standard JSON:

  1. C-style line comments and block comments intermixed with whitespace,
  2. allows trailing commas after the last member/element in an object/array.

All JSON is valid JWCC.

For details, see the JWCC docs at:

https://nigeltao.github.io/blog/2021/json-with-commas-comments.html

Formatting with hujsonfmt

hujsonfmt is a program that formats HuJSON files. Install it by running:

go install github.com/tailscale/hujson/cmd/hujsonfmt@latest

Visual Studio Code association

Visual Studio Code supports a similar jsonc (JSON with comments) format. To treat all *.hujson files as jsonc with trailing commas allowed, you can add the following snippet to your Visual Studio Code configuration:

"files.associations": {
    "*.hujson": "jsonc"
},
"json.schemas": [{
    "fileMatch": ["*.hujson"],
    "schema": {
        "allowTrailingCommas": true
    }
}]

Significant stargazers

(top 24 of 31)

Ruud van Asseldonk

411 followers · starred Oct 2022

Trent Mick

644 followers · starred Feb 2021

Smitty

91 followers · starred Dec 2021

Emmanuel T Odeke

716 followers · starred Nov 2024

tailscale/hujson

HuJSON: JSON for Humans (JWCC: JSON w/ comments and trailing commas)

Go

873

39 commits

updated Jul 27, 2026

See the code

README

HuJSON - "Human JSON" (JWCC)

Go Reference

The github.com/tailscale/hujson package implements the JWCC extension of standard JSON.

The JWCC format permits two things over standard JSON:

  1. C-style line comments and block comments intermixed with whitespace,
  2. allows trailing commas after the last member/element in an object/array.

All JSON is valid JWCC.

For details, see the JWCC docs at:

https://nigeltao.github.io/blog/2021/json-with-commas-comments.html

Formatting with hujsonfmt

hujsonfmt is a program that formats HuJSON files. Install it by running:

go install github.com/tailscale/hujson/cmd/hujsonfmt@latest

Visual Studio Code association

Visual Studio Code supports a similar jsonc (JSON with comments) format. To treat all *.hujson files as jsonc with trailing commas allowed, you can add the following snippet to your Visual Studio Code configuration:

"files.associations": {
    "*.hujson": "jsonc"
},
"json.schemas": [{
    "fileMatch": ["*.hujson"],
    "schema": {
        "allowTrailingCommas": true
    }
}]

Significant stargazers

(top 24 of 31)

Ruud van Asseldonk

411 followers · starred Oct 2022

Trent Mick

644 followers · starred Feb 2021

Smitty

91 followers · starred Dec 2021

Emmanuel T Odeke

716 followers · starred Nov 2024