> [!tldr] a modest extension to [[JSON]] to make it easier to maintain by hand
JSON5 is a real and already successful project I've not known the name of before. A lot of places I though I was interacting with [[JSON]] I was actually looking at JSON5.
Basically it's **[[JSON]]** but allowing stuff you can do in [[JavaScript]].
In short, JSON5 is just JSON +...
- Comments!
- Trailing commas are okay
- Use double quotes or asterisks
- Don't need quotes for the key
- Backwards compatible with regular JSON
## Kitchen Sink Example
From the source:
```json5
{
// comments
unquoted: 'and you can quote me on that',
singleQuotes: 'I can use "double quotes" here',
lineBreaks: "Look, Mom! \
No \\n's!",
hexadecimal: 0xdecaf,
leadingDecimalPoint: .8675309, andTrailing: 8675309.,
positiveSign: +1,
trailingComma: 'in objects', andIn: ['arrays',],
"backwardsCompatible": "with JSON",
}
```
Hey! It's a supported code block in [[Obsidian]] too! Nice.
****
# More
## Source
- json5.org