I'm looking for a diff equivalent written in JavaScript that only returns/prints relevant lines. I don't want both full text displayed next to each other with the differences highlighted, but just want the actual differences (plus some buffer lines to know where the difference is), similar to the output from the linux diff utility.
Does anybody know a javascript function that does this? All differences should be recognized (even changed whitespace). Thanks.
I completely rebuilt the jsdifflib utility for speed. Since my version does not require DOM access it at least 4.5 times faster, and it is also extended to highlight character differences in each line.
http://prettydiff.com/diffview.js
You can test this out with the online tool directly at http://prettydiff.com/
jsdifflib inline mode comparison, try tweaking the context size to display just the desired window of change you want. There's a demo here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With