canonicaljson

Canonical JSON according to RFC8785

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install canonicaljson
choosenim install canonicaljson
git clone https://github.com/jackhftang/canonicaljson.nim

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
canonicaljson - - - - - - -

README

canonicaljson

Stringify JSON according to RFC8785.

Usage

API

let s = canonify(%*{
  "numbers": [333333333.33333329, 1E30, 4.50,
              2e-3, 0.000000000000000000000000001],
  "string": "\u20ac$\u000f\u000aA'\u0042\u0022\u005c\\\"/",
  "literals": [newJNull(), true, false]
})

assert s == """{"literals":[null,true,false],"numbers":[333333333.3333333,1e+30,4.5,0.002,1e-27],"string":"€$\u000f\nA'B\"\\\\\"/"}"""