Popularity
6.1
Declining
Activity
0.0
Stable
70
8
14

Monthly Downloads: 105
Programming language: Elixir
License: MIT License
Tags: Protocols    
Latest version: v0.2.0

message_pack alternatives and similar packages

Based on the "Protocols" category.
Alternatively, view message_pack alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of message_pack or a related project?

Add another 'Protocols' Package

README

MessagePack for Elixir

Build Status

Installation

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

defp deps do
  [{:message_pack, "~> 0.2.0"}]
end

Usage

# pack
MessagePack.pack([1,2,3]) #=> { :ok, <<147,1,2,3>> }
MessagePack.pack!([1,2,3]) #=> <<147,1,2,3>>

# unpack
MessagePack.unpack(<<147,1,2,3>>) #=> { :ok, [1,2,3] }
MessagePack.unpack!(<<147,1,2,3>>) #=> [1,2,3]

# unpack_once
MessagePack.unpack_once(<<147,1,2,3,4>>) #=> {:ok, {[1, 2, 3], <<4>>}}
MessagePack.unpack_once!(<<147,1,2,3,4>>) #=> {[1, 2, 3], <<4>>}

Options

  • enable_string

Support string type. This options is false by default.

iex(1)> { :ok, bin } = MessagePack.pack(<<255>>)
{:ok, <<161, 255>>}
iex(3)> MessagePack.unpack(<<161, 255>>)
{:ok, <<255>>}
iex(4)> MessagePack.unpack(<<161, 255>>, enable_string: true)
{:error, {:invalid_string, <<255>>}}
  • ext

Support extention type.

See test/message_pack_ext_test.exs.

License

MIT


*Note that all licence references and agreements mentioned in the message_pack README section above are relevant to that project's source code only.