Utilities for parsing and querying JSON data
Find a file
2025-09-04 18:58:13 +10:00
.github/workflows Initial commit 2024-03-21 22:05:04 +11:00
src Rename internal function 2025-09-04 17:40:11 +10:00
test Major upgrade replacing parser with gleam_json 2025-09-04 17:36:35 +10:00
.gitignore Initial commit 2024-03-21 22:05:04 +11:00
gleam.toml Bump version to 2.0.1 2025-09-04 17:41:02 +10:00
manifest.toml Major upgrade replacing parser with gleam_json 2025-09-04 17:36:35 +10:00
README.md Update readme 2025-09-04 18:58:13 +10:00

jasper

Credit to kwando for the decoder and to_json functions. If the querying part of this library is not required, I recommend using their package json_value instead.

Package Version Hex Docs

gleam add jasper
import gleam/io
import jasper.{String, Root, Key, Index}

pub fn main() {
  let assert Ok(json) = jasper.parse("{ \"foo\": [1, true, \"hi\"] }")
  let assert Ok(String(str)) = jasper.query(json, Root |> Key("foo") |> Index(2))
  io.println(str)
}

Further documentation can be found at https://hexdocs.pm/jasper.

Development

gleam run   # Run the project
gleam test  # Run the tests
gleam shell # Run an Erlang shell