Library json

JSON library.

Functions

deserialize( string ) Deserialises a JSON encoded string.
serialize( table, prettyPrint ) Serialises a table using JSON.


Functions

json.deserialize( string )
Deserialises a JSON encoded string. Returns the deserialised table.

Environment:

Shared

Parameters:

  • string: A string of JSON encoded data.

Return value:

    (table) The JSON data as a table, or nil if it was not valid JSON.
json.serialize( table, prettyPrint )
Serialises a table using JSON. Returns the serialised string.

Environment:

Shared

Parameters:

  • table: The table to be serialised.
  • prettyPrint: Whether to pretty-print the output.

Return value:

    (string) A JSON string representing the table.

Valid XHTML 1.0!