File: json.el.html
This is a library for parsing and generating JSON (JavaScript Object Notation).
Learn all about JSON here: <URL:https://json.org/>.
The user-serviceable entry points for the parser are the functions
json-read and json-read-from-string. The encoder has a single
entry point, json-encode.
Since there are several natural representations of key-value pair
mappings in Elisp (alist, plist, hash-table), json-read allows you
to specify which you'd prefer (see json-object-type and
json-array-type).
Similarly, since false and null are distinct in JSON, you can
distinguish them by binding json-false and json-null as desired.
Defined variables (19)
json--path | Keeps track of the path during recursive calls to ‘json-read’. |
json--print-indentation-depth | Current indentation level during encoding. |
json--print-indentation-prefix | String used to start indentation during encoding. |
json--print-keyval-separator | String used to separate key-value pairs during encoding. |
json-array-type | Type to convert JSON arrays to. |
json-encoding-default-indentation | String used for a single indentation level during encoding. |
json-encoding-lisp-style-closings | If non-nil, delimiters ] and } will be formatted Lisp-style. |
json-encoding-object-sort-predicate | Sorting predicate for JSON object keys during encoding. |
json-encoding-pretty-print | If non-nil, then the output of ‘json-encode’ will be pretty-printed. |
json-encoding-separator | Value to use as an element separator when encoding. |
json-false | Value to use when reading JSON ‘false’. |
json-key-type | Type to convert JSON keys to. |
json-keywords | List of JSON keywords. |
json-null | Value to use when reading JSON ‘null’. |
json-object-type | Type to convert JSON objects to. |
json-post-element-read-function | If non-nil, a function to call after reading a JSON array or object. |
json-pre-element-read-function | If non-nil, a function to call before reading a JSON array or object. |
json-pretty-print-max-secs | Maximum time for ‘json-pretty-print’s comparison. |
json-special-chars | Characters which are escaped in JSON, with their Elisp counterparts. |