Support for Lua Modules

27 views
Skip to first unread message

Node Central

unread,
Jul 26, 2022, 9:45:09 AMJul 26
to rextester
Hi, how can I access Lua modules e.g. dkjson for code such as the following..

local json = require "dkjson"
local posttoconvert = [[

{"type": "Event","userId": 0,"userName": "Joe", "roomName": "Living Room", "sensorId": "98072D0B9B72", "event": {"name": "RoomEntry", "inControl": true}}
]]

local j = json.decode(posttoconvert)

--print(tprint(j))
local Type, userId, userName, sensorId, roomName, eventName, eventControl = j.type, j.userId, j.userName, j.roomName, j.sensorId, j.event.name, j.event.inControl


Reply all
Reply to author
Forward
0 new messages