1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
// Live demo.
// Type either into the Hjson or JSON input
// to convert to the other format.
// Reload to reset.
# comments are useful
# specify rate in requests/second
"rate": 1000
// maybe you prefer js style comments
/* or if you feel old fashioned */
# key names do not need to be placed in quotes
key: "value"
# you don't need quotes for strings
text: look ma, no quotes!
# note that for quoteless strings everything up
# to the next line is part of the string!
# commas are optional
commas:
{
one: 1
two: 2
}
# trailing commas are allowed
trailing:
{
one: 1,
two: 2,
}
# multiline string
haiku:
'''
JSON I love you.
But you strangle my expression.
This is so much better.
'''
# Obviously you can always use standard JSON syntax as well:
favNumbers: [ 1, 2, 3, 6, 42 ]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{
"rate": 1000,
"key": "value",
"text": "look ma, no quotes!",
"commas": {
"one": 1,
"two": 2
},
"trailing": {
"one": 1,
"two": 2
},
"haiku": "JSON I love you.\nBut you strangle my expression.\nThis is so much better.",
"favNumbers": [
1,
2,
3,
6,
42
]
}