Tools for comparing minimized Javascript files [closed]

安稳与你 提交于 2019-12-05 11:23:53

问题


I need to compare two minimized Javascript files. Most common diff viewers list differences per line, but this isn't useful when the script is compressed to a few lines.

Are there any good tools for comparing minimized Javascript files?


回答1:


Pretty Diff tool will diff two minified files or a minified to a beautified file with a single button click.

http://prettydiff.com/

It operates by first minifing files to remove comments and the beautifies the source code before running its diff algorithm. This is my tool, so if this does not do what you need I do take requests.




回答2:


Compressed java script files may not be compared directly. First format both the java script codes using java script beautifier. Then you can compare using any of the below tools:

Tools to compare the code:

  1. Beyond Compare
  2. Compare plugin available in Noteapad++
  3. WinMerge
  4. Prettydiff
  5. Kompare

Tools to Format the Javascript: 1. JavaScriptBeautifier.com

All above tools are available on internet and can be searched and downloaded on google.




回答3:


Our SmartDifferencer tool compares the code using the language syntax rather than text lines. By doing this, it isn't sensitive to or bollixed by formatting or minification.

It doesn't print "lines" containing differences; rather it prints out the code fragment which is different, whether that fragment covers several lines or is only a fragment in a current line. So it would probably do a good job of this.

There is a SmartDifferencer specific to each language, and in particular there is one for JavaScript.



来源:https://stackoverflow.com/questions/8589434/tools-for-comparing-minimized-javascript-files

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