The JSON module is used to create JSON from Lua tables.
The code in this module is open source written by Tyler Neylon the original source can be found here.
This does not work with the gobs table as is. For this reason you will need to create a duplicate table of the gobs to call with.
This can be done as follows
local newGobs=load("return " .. table.tostring(gobs,"","",""))()
As usual you will need to import the Json module before you can use it,
This converts a Lua table into a json string object.
function json.stringify(obj, as_key)
objis the table you would like back as a string.
as_keyis the key for that json object. Leave empty for most cases.
This will parse Json into a lua table.
function json.parse(str, pos, end_delim)
strThe json string value.
posleave empty this is used for nested calls.
end_delimleave empty this is used for nested calls.