←back to thread

Fixing JSON

(www.tbray.org)
139 points robin_reala | 1 comments | | HN request time: 0.208s | source
1. donpdonp ◴[] No.12327979[source]
One way to get a comma-free JSON-like format is to write the document in hjson, which is a superset of JSON.

http://hjson.org/

var config = HJSON.parse(fs.fileReadSync('config.hjson'))

Another more obscure, and more powerful serialization format that does away with commas (commas are treated as whitespace!), has a date type, and much more is Rich Hickey's (of Clojure fame) EDN. https://github.com/edn-format/edn

{:a 1, "foo" :bar, [1 2 3] four}