Home

Awesome

elm-protobuf

Build Status Go Report Card

Join #elm-protobuf on Slack

Experimental protobuf plugin generating elm code to decode/encode Proto3/JSON from proto definitions.

The plugin itself is written in Go, and it requires the base protoc protobuf compiler to be installed on the system.

For a sample generated output file, see Repeated.elm.

Supported features

How to install

Release

The simplest way to install the plugin is to download a pre-compiled binary from https://github.com/tiziano88/elm-protobuf/releases , then unpack it and copy or move the protoc-gen-elm binary somewhere in your $PATH.

From source

How to run

Run the protoc compiler specifying the --elm_out flag:

protoc --elm_out=. *.proto

protoc will automatically detect the protoc-gen-elm binary from your $PATH and use it to generate the output elm code.

Then, in your project, add a dependency on the runtime library:

elm install tiziano88/elm-protobuf

References

https://developers.google.com/protocol-buffers/

https://developers.google.com/protocol-buffers/docs/proto3#json

https://developers.google.com/protocol-buffers/docs/reference/cpp/google.protobuf.compiler.plugin.pb

https://github.com/google/protobuf/wiki/Third-Party-Add-ons