compact.lua
LUA:
function parseToJson(data, fileName)
local fileEx = string.format("data/json/%s.json", fileName)
local outputFile = fileEx
json = require('data/lib/custom/json')
fileEx = io.open(fileEx, "w+")
fileEx:write(json.stringify(data))
fileEx:close()
print("#############################")
print("File saved as " .. outputFile)
print("----")
print(fileName .. " parsed to JSON")
return true
end
json.lua
-- add to lib/core, later add dofile in lib/core/core.lua---- json.lua-- - Pastebin.com
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.