Last active
February 20, 2017 15:04
-
-
Save geofflane/b6ac9934bd32fe394c4abfd95d5e1600 to your computer and use it in GitHub Desktop.
Convert JSON to a file containing an Elixir Map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
map = File.read!("/path/to/file.json") |> Poison.decode!() | |
{:ok,of} = File.open("/path/to/file.exs", [:write, :utf8]) | |
IO.inspect(of, map, limit: 100000, pretty: true) | |
File.close!(of) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment