Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tailscale/hujson
HuJSON: JSON for Humans (JWCC: JSON w/ comments and trailing commas)
https://github.com/tailscale/hujson
Last synced: about 7 hours ago
JSON representation
HuJSON: JSON for Humans (JWCC: JSON w/ comments and trailing commas)
- Host: GitHub
- URL: https://github.com/tailscale/hujson
- Owner: tailscale
- License: bsd-3-clause
- Created: 2019-09-29T22:14:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-10T21:20:12.000Z (29 days ago)
- Last Synced: 2024-11-05T21:45:32.450Z (3 days ago)
- Language: Go
- Homepage:
- Size: 254 KB
- Stars: 604
- Watchers: 33
- Forks: 21
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- go-awesome - hujson - supports JSON decoding for annotations (Open source library / JSON)
README
# HuJSON - "Human JSON" ([JWCC](https://nigeltao.github.io/blog/2021/json-with-commas-comments.html))
The `github.com/tailscale/hujson` package implements
the [JWCC](https://nigeltao.github.io/blog/2021/json-with-commas-comments.html) extension
of [standard JSON](https://datatracker.ietf.org/doc/html/rfc8259).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
## 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:```json
"files.associations": {
"*.hujson": "jsonc"
},
"json.schemas": [{
"fileMatch": ["*.hujson"],
"schema": {
"allowTrailingCommas": true
}
}]
```