dag_json

Bindings to the js implementation of dag-json.

Package Version Hex Docs

npm install --save @ipld/dag-json@10
gleam add dag_json@1
import dag_json as codec
import gleam/json

pub fn code_test() {
  codec.code()
  |> should.equal(297)
}

pub fn name_test() {
  codec.name()
  |> should.equal("dag-json")
}

pub fn encode() {
  json.array([2], json.int)
  |> codec.encode
}

pub fn decode() {
  <<"{\"bar\":\"baz\"}">>
  |> codec.decode
}

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

Development

gleam run   # Run the project
gleam test  # Run the tests

Credit

Created for EYG, a new integration focused programming language.

Search Document