Liking cljdoc? Tell your friends :D

psosf.json

A small, dependency-free JSON reader and writer.

Objects read as maps with string keys, so documents can be written back in canonical form exactly. Two writers:

(write-canonical x) two-space indentation, one key or element per line, keys sorted at every level, final line feed; the form PSOSF requires for manifest.json, signatures.json and test.json (write-compact x) no insignificant whitespace, keys sorted; the form PSOSF requires for line 3 styles

Non-ASCII characters are written as UTF-8, never escaped.

A small, dependency-free JSON reader and writer.

Objects read as maps with string keys, so documents can be written back in
canonical form exactly. Two writers:

  (write-canonical x)  two-space indentation, one key or element per line,
                       keys sorted at every level, final line feed; the form
                       PSOSF requires for manifest.json, signatures.json and
                       test.json
  (write-compact x)    no insignificant whitespace, keys sorted; the form PSOSF
                       requires for line 3 styles

Non-ASCII characters are written as UTF-8, never escaped.
raw docstring

max-depthclj/s

The deepest nesting of arrays and objects read. PSOSF's JSON needs only a few levels; the limit keeps a hostile document from exhausting the stack.

The deepest nesting of arrays and objects read. PSOSF's JSON needs only a
few levels; the limit keeps a hostile document from exhausting the stack.
sourceraw docstring

max-safe-integerclj/s

The largest integer every platform represents exactly: 2^53 - 1, the limit of a JavaScript number. Integers beyond it are refused, so the JVM, .NET and JavaScript never read the same text as different numbers.

The largest integer every platform represents exactly: 2^53 - 1, the limit
of a JavaScript number. Integers beyond it are refused, so the JVM, .NET
and JavaScript never read the same text as different numbers.
sourceraw docstring

read-strclj/s

(read-str s)

Parses a JSON document. Throws ex-info with :psosf/json-error on bad input.

Parses a JSON document. Throws ex-info with :psosf/json-error on bad input.
sourceraw docstring

write-canonicalclj/s

(write-canonical x)

Canonical JSON: two-space indentation, one key or element per line, keys sorted at every level, and a final line feed.

Canonical JSON: two-space indentation, one key or element per line, keys
sorted at every level, and a final line feed.
sourceraw docstring

write-compactclj/s

(write-compact x)

Compact JSON with keys sorted at every level.

Compact JSON with keys sorted at every level.
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