json.save(file, value)function
Encode a Lua value to a JSON representation string and save it to a file.
Parameters
file
A File object or a filename string, representing the file to save the JSON data.
value
Lua value to be encoded.
Return value
Returnstrue or false in case of error.
Example
--! luart-extensions
import json
local t = {name = "John", age = 30, car = "null"}
-- save table content to a file as JSON, should be {"name":"John", "age":30, "car":null}
json.save("test.json", t)