Implementation of Newline Delimited JSON (NDJSON) for Elixir
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
config Add credo configuration Oct 2, 2018
lib
spec Add JSON/NDJSON parser specs Sep 28, 2018
.formatter.exs
.gitignore
.travis.yml Add credo configuration Oct 2, 2018
CHANGELOG.md Release v0.1.0 Oct 1, 2018
LICENSE
README.md Update README.md Sep 29, 2018
VERSION Release v0.1.0 Oct 1, 2018
mix.exs
mix.lock Add package description + ExDoc Sep 30, 2018

README.md

ExNdjson

Build Status Hex.pm Version Hex.pm Download Total

ExNdjson is a Newline-delimited JSON library for Elixir that implements encoding and decoding to/from NDJSON as described in NDJSON Spec.

Installation

First, Add ExNdjson to you mix.exs dependencies:

def deps do
  [
    {:ex_ndjson, "~> 0.1.0"}
  ]
end

Then, update your dependencies:

mix deps.get

Usage

ExNdjson.marshal!([%{"some" => "thing"}, %{"bar" => false, "foo" => 17, "quux" => true}])
#=> "{\"some\":\"thing\"}\n{\"quux\":true,\"foo\":17,\"bar\":false}\n"

ExNdjson.unmarshal('{"some": "thing"}\n{"quux":true, "foo":17, "bar": false}\r\n')
#=> [%{"some" => "thing"}, %{"bar" => false, "foo" => 17, "quux" => true}]

ExNdjson.unmarshal(<<123, 125, 10>>)
#=> [%{}]

Documentation

Full documentation can be found at https://hexdocs.pm/ex_ndjson.

License

The library is available as open source under the terms of the MIT License.