janssonr: Strict JSON Encoding and Decoding via the 'Jansson' C Library

An R-safe profile of RFC 8259 JSON: parsing and generation backed by the 'Jansson' C library, linked as a system library where one is available and compiled from the bundled sources otherwise. The parser rejects, with classed conditions carrying line, column, and byte position: malformed or truncated input, trailing content, duplicate object keys at any depth, invalid UTF-8, escapes encoding a null character, reals overflowing double, and integer literals whose magnitude exceeds 2^53, the range within which a double represents every integer exactly. Number literals with a fraction or exponent convert by ordinary correctly rounded IEEE 754 double conversion. Objects decode to named lists in key order, arrays to unnamed lists, and scalars to length-one vectors. The encoder maps named lists to objects in insertion order, unnamed lists to arrays, guarantees that every finite double, signed zero included, round-trips to the exact same value (whole-number doubles are written as integers), and refuses values with no faithful JSON representation (NA, NaN, infinities, named atomic vectors, classed objects) instead of guessing. No R package dependencies.

Version: 0.1.2
Depends: R (≥ 4.4.0)
Suggests: tinytest
Published: 2026-09-12
DOI: 10.32614/CRAN.package.janssonr (may not be active yet)
Author: Troy Hernandez ORCID iD [aut, cre], cornball.ai [cph], Petri Lehtinen [ctb, cph] (Author of the Jansson C library, bundled under src/jansson), Basile Starynkevitch [ctb, cph] (Jansson: src/jansson/memory.c), Graeme Smecher [ctb, cph] (Jansson: src/jansson/pack_unpack.c), Sean Bright [ctb, cph] (Jansson: src/jansson/version.c), David M. Gay [ctb] (Author of dtoa.c, bundled by Jansson as src/jansson/dtoa.c), Lucent Technologies [cph] (src/jansson/dtoa.c), Bob Jenkins [ctb] (Author of lookup3.c (public domain), bundled by Jansson as src/jansson/lookup3.h)
Maintainer: Troy Hernandez <troy at cornball.ai>
BugReports: https://github.com/cornball-ai/janssonr/issues
License: MIT + file LICENSE
Copyright: cornball.ai, except the bundled Jansson sources under src/jansson, whose per-file copyright holders and license statements are listed in inst/COPYRIGHTS.
janssonr copyright details
URL: https://github.com/cornball-ai/janssonr
NeedsCompilation: yes
SystemRequirements: jansson (>= 2.11) is linked when present: libjansson-dev (deb), jansson-devel (rpm), jansson (brew). When it is absent, and always on Windows, the bundled Jansson 2.15.1 is compiled into the package.
Materials: README, NEWS
CRAN checks: janssonr results

Documentation:

Reference manual: janssonr.html , janssonr.pdf

Downloads:

Package source: janssonr_0.1.2.tar.gz
Windows binaries: r-devel: not available, r-release: not available, r-oldrel: not available
macOS binaries: r-release (arm64): not available, r-oldrel (arm64): janssonr_0.1.2.tgz, r-release (x86_64): janssonr_0.1.2.tgz, r-oldrel (x86_64): janssonr_0.1.2.tgz

Linking:

Please use the canonical form https://CRAN.R-project.org/package=janssonr to link to this page.