Erlang ❤️ JSON

Notes

Erlang 27 just came out, and one of the highlights is the new built-in :json module!

Here’s how you can use it:

iex(1)> result = :json.encode(%{hello: "world"})
[~c"{", [[34, "hello", 34], 58, 34, "world", 34], [], ~c"}"]

iex(2)> result |> to_string() |> :json.decode()
%{"hello" => "world"}

Voilà! JSON encoding and decoding straight out of the box!

Want the latest Elixir Streams in your inbox?

    No spam. Unsubscribe any time.