Appearance
JSON
Reference for the json API.
Functions
json.encode
Encodes a table into an instance of json.
lua
---@param data table
function json.encode(data): jsonjson.decode
Decodes an instance of json into a table.
lua
---@param json json
function json.decode(json): tableTypes
json
lua
---@param indent? integer
function json:dump(indent?): stringExamples
lua
local data = {a=1, name='test'}
local json = json.encode(data)
print(json:dump()) -- '{ "a": 1, "name": "test" }'