Json

Json

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,
local json=require("json")

json.stringify

This converts a Lua table into a json string object.
function json.stringify(obj, as_key)
obj is the table you would like back as a string.
as_key is the key for that json object. Leave empty for most cases.

json.parse

This will parse Json into a lua table.
function json.parse(str, pos, end_delim)
str The json string value.
pos leave empty this is used for nested calls.
end_delim leave empty this is used for nested calls.
 
Built with Potion.so