tcxcvg
Last Updated: September 09, 2019
·
4.536K
· iraycd

Why JSON5?

JSON5 is a proposed extension to JSON that aims to make it easier for humans to write and maintain by hand.

Many ask why the hell do we need comments in the first place?

There are many reasons. But JSON5 makes it JSON format that is ideal for configurations many suggested to use YAML.
YAML is annoying, can't use tabs, you have to use spaces... and most yaml parses if they see a tab don't warn you or anything. Highly annoying for configuration files.

If you love YAML and hate JSON5 here is an answer for you. ;)

If web browsers had native YAML parsing, we probably wouldn't need JSON5. Web browsers aren't going to get native YAML parsing.

What I think are amazing about JSON5

  • Great for config files.
  • Comment ( Obviously )
  • Trailing Comma
  • Passing Hex
  • Single-quoted String.

Note : JSON5 is not an official successor to JSON, and JSON5 content may not work with existing JSON parsers. For this reason, JSON5 files use a new .json5 extension. (TODO: new MIME type needed too.)

2 Responses
Add your response

13184

Read more about JSON5 at http://json5.org/

over 1 year ago ·
13185

HAHA.. I forgot to add link. Thanks for reminding.

over 1 year ago ·