Johnson
Decode and encode JSON without altering the key order.
Installation
The package can be installed by adding johnson to your list of dependencies in mix.exs:
def deps do
[
{:johnson, "~> 1.0.0"}
]
endBasic Usage
iex(1)> Johnson.decode!(~s({"a":"a","b":"b"}))
%Johnson{data: [{"a", "a"}, {"b", "b"}]}
iex(2)> Johnson.encode!(%Johnson{data: [{"a", "a"}, {"b", "b"}]})
~s({"a":"a","b":"b"})
iex(3)> Johnson.get(%Johnson{data: [{"a", "a"}, {"b", "b"}]}, "a")
"a"Documentation
The docs can be found at https://hexdocs.pm/johnson.
License
This library is released under the MIT License.
See the COPYING file for full license information.