The kmj-json package provides a JSON codec.
The runtime provides this library through the luaL_newlib auxiliary library function, so all fields can be assumed to be functions.
The decode field contains a function for decoding a JSON encoded type.
decode(input: string): (output: any)
nil
if the input could not be interpreted successfully.The encode field contains a function for encoding a Lua value into a JSON encoded type.
encode(input: any): (output: string|nil)
nil
if an unsupported value such as function, userdata or thread was given.