Answers for "elixir json parser"

1

elixir file open and parse json

defmodule Test do
  def get_json(filename) do
    with {:ok, body} <- File.read(filename),
         {:ok, json} <- Poison.decode(body), do: {:ok, json}
  end
end
Posted by: Guest on May-27-2021

Browse Popular Code Answers by Language