gj

A fast, spec compliant, generic JSON parser and encoder in Gleam

Quick Usage

> gj.decode("[1]")
Ok(Array([Number(1.0)]))

> gj.encode(Array([Number(1.0)]))
Ok("[1.0]")

Functions

pub fn decode(
  str: String,
) -> Result(JSON, tuple(ParseError, ParseErrorLocation))
pub fn encode(json: JSON) -> String