Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 882 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 882 Bytes

JSONDiff

JSONDiff is an Elixir implementation of the diffing element of the JSON Patch format, described in RFC 6902.

This library only handles diffing. For patching, see the wonderful JSONPatch library.

This library only supports add, replace and remove operations.

It is based on the very fast JavaScript library JSON-Patch

Examples

iex> JSONDiff.diff(%{"a" => 1}, %{"a" => 2})
[%{"op" => "replace", "path" => "/a", "value" => 2}]

iex> JSONDiff.diff([1], [2])
[%{"op" => "replace", "path" => "/0", "value" => 2}]

Installation

# mix.exs
def deps do
  [
    {:json_diff, "~> 0.1.2"}
  ]
end

Authorship and License

JSONDiff is released under the MIT License, available at LICENSE.txt.