Skip to content

JSON

Functions

Return Type Name Description
table json.to_table(nlohmann_json json) Converts nlohmann_json to a table
nlohmann_json json.from_table(table tbl) Converts a table to nlohmann_json

Types

nlohmann_json

Return Type Name Description
string dump(number? indent) Stringify the JSON object

Examples

-- Serializing a table to json
local tbl = {a = 1, b = 2}
local json = json.from_table(tbl)
print(json:dump()) -- {"a":1,"b":2}