Liking cljdoc? Tell your friends :D

bridge.json

JSON encode/decode with a runtime-selected backend. The JVM artifact ships charred; Babashka uses its bundled cheshire.

Preference order on the JVM:

  1. charred — reflection-free, GraalVM native-image friendly (no Jackson);
  2. clojure.data.json;
  3. cheshire.

Under Babashka only cheshire is used: charred and data.json do not load under SCI. Compact output disables slash/unicode escaping where the backend supports it so it stays byte-stable across runtimes; pretty output layout may still differ between backends.

JSON encode/decode with a runtime-selected backend. The JVM artifact ships
charred; Babashka uses its bundled cheshire.

Preference order on the JVM:
  1. charred        — reflection-free, GraalVM native-image friendly (no Jackson);
  2. clojure.data.json;
  3. cheshire.

Under Babashka only cheshire is used: charred and data.json do not load under
SCI. Compact output disables slash/unicode
escaping where the backend supports it so it stays byte-stable across runtimes;
pretty output layout may still differ between backends.
raw docstring

read-strclj

(read-str s & {:keys [key-fn] :or {key-fn identity}})

Parse a JSON string into Clojure data. :key-fn maps object keys (default identity, i.e. string keys); pass keyword to keywordize.

Parse a JSON string into Clojure data. `:key-fn` maps object keys (default
`identity`, i.e. string keys); pass `keyword` to keywordize.
sourceraw docstring

write-pretty-strclj

(write-pretty-str data)

Serialize data to an indented JSON string.

Serialize `data` to an indented JSON string.
sourceraw docstring

write-strclj

(write-str data)

Serialize data to a compact JSON string.

Serialize `data` to a compact JSON string.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close