Answers for "elixir file open and parse json"

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

Code answers related to "Javascript"

Browse Popular Code Answers by Language