On this page
hs.json
JSON encoding and decoding
This module is based partially on code from the previous incarnation of Mjolnir by Steven Degutis.
API Overview
API Documentation
Functions
decode
Signature | hs.json.decode(jsonString) -> table |
---|---|
Type | Function |
Description | Decodes JSON into a table |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/json/libjson.m line 139 |
encode
Signature | hs.json.encode(val[, prettyprint]) -> string |
---|---|
Type | Function |
Description | Encodes a table as JSON |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/json/libjson.m line 112 |
read
Signature | hs.json.read(path) -> table | nil |
---|---|
Type | Function |
Description | Decodes JSON file into a table. |
Parameters |
|
Returns |
|
Source | extensions/json/libjson.m line 197 |
write
Signature | hs.json.write(data, path, [prettyprint], [replace]) -> boolean |
---|---|
Type | Function |
Description | Encodes a table as JSON to a file |
Parameters |
|
Returns |
|
Source | extensions/json/libjson.m line 164 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.json.html