Msgpax Build Status

This library provides an API for serializing and de-serializing Elixir terms using the MessagePack format.

Installation

Add Msgpax as a dependency in your mix.exs file:

def deps do
  [{:msgpax, github: "lexmag/msgpax"}]
end

After you are done, run mix deps.get in your shell to fetch the dependencies.

Usage

iex> {:ok, bin} = Msgpax.pack([300, "Spartans"])
{:ok, <<146, 205, 1, 44, 168, 83, 112, 97, 114, 116, 97, 110, 115>>}
iex> bin = Msgpax.pack!([300, "Spartans"])
iex> {:ok, term} = Msgpax.unpack(bin)
{:ok, [300, "Spartans"]}
iex> term = Msgpax.unpack!(bin)
[300, "Spartans"]

License

This software is licensed under the ISC license.