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--pathKeeps track of the path during recursive calls to ‘json-read’.
json--print-indentation-depthCurrent indentation level during encoding.
json--print-indentation-prefixString used to start indentation during encoding.
json--print-keyval-separatorString used to separate key-value pairs during encoding.
json-array-typeType to convert JSON arrays to.
json-encoding-default-indentationString used for a single indentation level during encoding.
json-encoding-lisp-style-closingsIf non-nil, delimiters ] and } will be formatted Lisp-style.
json-encoding-object-sort-predicateSorting predicate for JSON object keys during encoding.
json-encoding-pretty-printIf non-nil, then the output of ‘json-encode’ will be pretty-printed.
json-encoding-separatorValue to use as an element separator when encoding.
json-falseValue to use when reading JSON ‘false’.
json-key-typeType to convert JSON keys to.
json-keywordsList of JSON keywords.
json-nullValue to use when reading JSON ‘null’.
json-object-typeType to convert JSON objects to.
json-post-element-read-functionIf non-nil, a function to call after reading a JSON array or object.
json-pre-element-read-functionIf non-nil, a function to call before reading a JSON array or object.
json-pretty-print-max-secsMaximum time for ‘json-pretty-print’s comparison.
json-special-charsCharacters which are escaped in JSON, with their Elisp counterparts.

Defined functions (56)

json--check-position(POSITION)
json--decode-utf-16-surrogates(HIGH LOW)
json--plist-nreverse(PLIST)
json--print(OBJECT)
json--print-alist(ALIST &optional DESTRUCTIVE)
json--print-array(ARRAY)
json--print-indentation()
json--print-key(OBJECT)
json--print-keyword(KEYWORD)
json--print-list(LIST)
json--print-map(MAP)
json--print-pair(KEY VAL)
json--print-string(STRING &optional FROM)
json--print-stringlike(OBJECT)
json--print-unordered-map(MAP)
json--record-path(KEY)
json--with-indentation(&rest BODY)
json--with-output-to-string(&rest BODY)
json-add-to-object(OBJECT KEY VALUE)
json-advance(&optional N)
json-advance--inliner(INLINE--FORM &optional N)
json-alist-p(LIST)
json-encode(OBJECT)
json-encode-alist(ALIST)
json-encode-array(ARRAY)
json-encode-hash-table(OBJECT)
json-encode-key(OBJECT)
json-encode-keyword(KEYWORD)
json-encode-list(LIST)
json-encode-number(OBJECT)
json-encode-plist(PLIST)
json-encode-string(STRING)
json-join(STRINGS &optional SEPARATOR)
json-new-object()
json-path-to-position(POSITION &optional STRING)
json-peek()
json-peek--inliner(INLINE--FORM)
json-plist-p(LIST)
json-pop()
json-pop--inliner(INLINE--FORM)
json-pretty-print(BEGIN END &optional MINIMIZE)
json-pretty-print-buffer(&optional MINIMIZE)
json-pretty-print-buffer-ordered(&optional MINIMIZE)
json-pretty-print-ordered(BEGIN END &optional MINIMIZE)
json-read()
json-read-array()
json-read-escaped-char()
json-read-file(FILE)
json-read-from-string(STRING)
json-read-keyword(KEYWORD)
json-read-number()
json-read-object()
json-read-string()
json-readtable-dispatch(CHAR)
json-skip-whitespace()
json-skip-whitespace--inliner(INLINE--FORM)

Defined faces (0)