JavaScript based diff utility [closed]

可紊 提交于 2019-11-28 02:50:52

jsdifflib inline mode comparison, try tweaking the context size to display just the desired window of change you want. There's a demo here

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/

There's also google-diff-match-patch from Google

Also available on NPM

npm install diff-match-patch
  • Mergely is totally worth checking out. CodeMirror-based, client-side only.
  • Then there's the CodeMirror demo which requires server-side diff computation.
  • jsdifflib and prettydiff as mentioned in other answers.

Checkout my minimal implementation: https://github.com/Slava/diff.js

realshadow

I dont know much about the diff utility in linux or linux in general, but this might be what you are looking for jsdifflib. You can find a live example there and see if it works for you.

Check out CodeMirror. Nuff said.

Check out the the wikEd diff JavaScript library. There is also an online tool.

wikEd diff features inline text comparisons with block move highlighting and character/word-based resolution. It is optimized for Wikipedia source text, but works great for any type of text or code. The library code is fully customizable, has Unicode support, is extensively commented, and is in the public domain.

old question i know, but if your doing node work or want something that is compatible with requirejs/commonjs module

I've really liked https://www.npmjs.com/package/diff

console.log(diff.createPatch('some file name.txt', expected, actual));
Justin Ethier

jsdifflib looks promising - try the demo linked from that page.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!