Is JSON5 a better JSON?

Yes it is, at least when it comes to configuration files.

As I said earlier, JSON is a good serialization language but a terrible config language. JSON5 builds on its strong sides: it's backwards compatible with JSON and is still a subset of JavaScript and it is still relatively easy to parse. Then it adds all the good stuff like unquoted keys, trailing commas, and a must-have thing for any config, comments. For me it has only two real downsides, both really minor. First is, as most config-oriented languages, it's tricky for automated modification, a feature it shares with TOML and YAML. The second one is JSON6, while ES6 syntax sugar is nice, it's just a 15th competing standard, and the worst, competing with itself.

Comments

Comments powered by Disqus