Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by elixirforum.com #
 
PREVIOUS NEXT
Tagged: #elixir #file #open #parse #json
ADD COMMENT
Topic
Name
1+8 =