Utilities for parsing and querying JSON data
Go to file
LilyRose2798 521283a17c Change repo back to github and add link to self-hosted git 2024-03-24 22:34:47 +11:00
.github/workflows Initial commit 2024-03-21 22:05:04 +11:00
src Fix string escaping parsing issue 2024-03-24 18:57:26 +11:00
test Initial commit 2024-03-21 22:05:04 +11:00
.gitignore Initial commit 2024-03-21 22:05:04 +11:00
README.md Initial commit 2024-03-21 22:05:04 +11:00
gleam.toml Change repo back to github and add link to self-hosted git 2024-03-24 22:34:47 +11:00
manifest.toml Fix formatting in manifest.toml 2024-03-24 18:56:59 +11:00

README.md

jasper

Package Version Hex Docs

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

pub fn main() {
  let assert Ok(json) = parse_json("{ \"foo\": [1, true, \"hi\"] }")
  let assert Ok(String(str)) = query_json(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