3 ms·
JSON5 is also a great alternative: https://json5.org/ https://json5.org/ Supports comments, trailing commas, single quotes, multi-line strings, and more number
by spankalee 8y ago
JSON5 is also a great alternative: https://json5.org/ https://json5.org/
Supports comments, trailing commas, single quotes, multi-line strings, and more number formats.
- nojvek 8y agoI really wished json5 would support optional commas as well. If you have a new line, no comma needed. So you can do [ 1 2 3 ] New lines used by humans, computers should do a good job as well.
- spankalee 8y agoThat's not a subset of JavaScript though.
- adamkruszewski 8y agoIt looks very like an s-expression. Maybe we should go back to Lisp for our data encoding? (and to our code when we are at it? ;))
- Sean1708 8y agoLike https://hjson.org/ https://hjson.org/?
- spiralx 8y agoWell you could use CSON, which uses CoffeeScript notation that allows for constructs such as: required: [ 'firstName' 'lastName' ] which is the same as: { "required": [ "firstName", "lastName" ] } in JSON :)