local personString = '{"name": "Squid", "job": "dev"}' -- A JSON string
-- If you need to turn the json into an object:
local personJSON = json.decode(personString)
-- Now you can use it like any table:
personJSON["name"] = "Illusion Squid"
personJSON.job = "Software Engineer"
-- If you have an object and want to make it a JSON string do this:
local newPersonString = json.encode(personJSON)
-- Simple!
-- If you do not use this for FiveM, there are several packages that can do what you are looking for.
-- I would recommend the implementation that FiveM has in pure LuA, it is very easy to use.
-- https://github.com/citizenfx/fivem/blob/master/code/tools/build/json.lua
-- You use it like this:
local table = {x = 5}
local encodeTable = json.encode(table) -- returns '{"x":5}'
local decodedTable = json.decode(encodedTable) -- returns {x = 5}
print(decodedTable.x) -- returns 5