Pure Javascript library for comparing two Jsons. As an output returns well define structure so you can always use it to present JSON diff in whatever way you like.
It is super simple ! Just open test/SpecRunner.html.jst
in your browser !
The output of getDiffRepresentation
is a tree. The root of the tree is represented in the following way:
{
"type": < "OBJECT" | "ARRAY" | "NULL" >,
"diff": [ nodes ]
}
Nodes representation:
{
"key": ...,
"value": < scalar value | [ nodes ] >,
"valueType": < "SCALAR" | "OBJECT" | "ARRAY" | "NULL" >,
"op": < "ADD" | "REMOVE" | "NONE" >
}
If you are interested in some examples you can find them here !