docs » hs.json
JSON encoding and decoding
This module is based partially on code from the previous incarnation of Mjolnir by Steven Degutis.
Signature | hs.json.decode(jsonString) -> table |
---|---|
Type | Function |
Description | Decodes JSON into a table |
Parameters |
|
Returns |
|
Notes |
|
Signature | hs.json.encode(val[, prettyprint]) -> string |
---|---|
Type | Function |
Description | Encodes a table as JSON |
Parameters |
|
Returns |
|
Notes |
|
| Signature | hs.json.read(path) -> table | nil
|
| -----------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| Type | Function |
| Description | Decodes JSON file into a table. |
| Parameters |
- path - The path and filename of the JSON file to read.
- A table representing the supplied JSON data, or
nil
if an error occurs.
Signature | hs.json.write(data, path, [prettyprint], [replace]) -> boolean |
---|---|
Type | Function |
Description | Encodes a table as JSON to a file |
Parameters |
|
Returns |
|