-
-
Notifications
You must be signed in to change notification settings - Fork 14
Description
In order to generate the difference between two JSON data, either we can use an existing library or implement our own JSON diffing library, but before we make that decision, I think it's important that we look at some great existing JSON diffing libraries.
If none of them work according to our needs, then can look into implementing our own.
After looking at some most popular as well as some most suitable libraries, I came up with these diffing libraries:
- https://github.com/flitbit/diff (
deep-diff
) - https://github.com/andreyvit/json-diff (
diff
) - https://github.com/benjamine/jsondiffpatch (
jsondiffpatch
) - https://github.com/chbrown/rfc6902 (
rfc6902
) - https://github.com/kpdecker/jsdiff (
diff
) - https://github.com/Starcounter-Jack/JSON-Patch (
fast-json-patch
) - https://www.npmjs.com/package/just-diff (
just-diff
)
After having tried them all, the most suitable library to me was: deep-diff
Reason:
- No external dependencies, thus not having to worry about frequently updating the library.
- Suitable diff output, this included the
type
of change, what's the current values, what was the previous one, and the path where the change has been made.
But before we agree on this, we have to make sure that this library is really suitable for us in terms of performance, the output, etc.
Therefore, this issue has been made in order to start a discussion on it. Also, whether we should really go with a ready-made library or make our own.