🛑 Unsuitable for production until v1.0 is released.
JSON handler for AutoHotkey; RFC 8259 compliant, tested rigorously, zero-dependency.
JSON.Parse(jsonString)
JSON.Stringify(data)
Parsing JSON
input := '{"a": "foo", "b": null, "c": 13.37, "d": {"a": [1, 2, 3]}}'
data := JSON.Parse(input)
; these are equal
data['a'] == 'foo'
data['b'] == JSON.Null
data['c'] == 13.37
data['d']['a'][3] == 3
Outputting JSON
; using `data` from above example
output := JSON.Stringify(data)
output == '{"a":"foo","b":null,"c":13.37,"d":{"a":[1,2,3]}}'
output := JSON.Stringify(data, true) ; pretty print
output == '
(
{
"a": "foo",
"b": null,
"c": 13.37,
"d": {
"a": [
1,
2,
3
]
}
}
)'
MIT © Vladimirs Nordholm