JSON (json)
json
JSON encode/decode, dot-path access, merge, search, flatten, and utility functions.
13 functions
Lua 5.3
json.json.clear
json.clear(t, path)Remove value at dot-path (set to nil).
json.json.count
json.count(data [, path])Count keys/elements at path.
json.json.decode
json.decode(json_string)Decode JSON string to Lua table. Auto-repairs trailing commas, multiple root objects.
json.json.encode
json.encode(table)Encode Lua table to JSON string.
json.json.find
json.find(data, key)Recursively find first value matching key.
json.json.flatten
json.flatten(data)Flatten nested structure to dot-notation keys.
json.json.has
json.has(data, path)Check if path exists in data.
json.json.keys
json.keys(data [, path])Get array of keys at path.
json.json.merge
json.merge(a, b)Deep merge two tables/JSON.
json.json.pretty
json.pretty(data)Pretty-print JSON with indentation and sorted keys.
json.json.read
json.read(data, path)Read value at dot-path.
json.json.update
json.update(data, path, value)Set value at dot-path.
json.json.vtype
json.vtype(data [, path])Get JSON type of value at path.