aboutsummaryrefslogtreecommitdiff
path: root/lib/json/README.md
blob: eb0d6c8838c4356e804aa8f53f5e0fcc39f4a748 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# JSON

This is a library for encoding/decoding JSON values.

## Usage

```tomo
j := JSON.Object({"key": Number(1.5), "key": Array([Boolean(yes), Null])})
say("$(j.encode())")
say("$(j.pretty_print())")

when JSON.parse("[1, null, true]") is Success(obj)
    >> obj
is Failure(msg)
    fail("Failed to parse JSON: $msg")
```