📜  elixir 文件打开并解析 json - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:42.440000             🧑  作者: Mango

代码示例1
defmodule Test do
  def get_json(filename) do
    with {:ok, body} <- File.read(filename),
         {:ok, json} <- Poison.decode(body), do: {:ok, json}
  end
end