You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 5, 2024. It is now read-only.
Neil Fraser edited this page Feb 10, 2018
·
1 revision
Each language port of Diff Match Patch uses the same API. These are the language-specific notes regarding JavaScript.
javascript/diff_match_patch_uncompressed.js is the human-readable version. This should be used by developers and Node.js.
javascript/diff_match_patch.js has been compressed using Google's Closure Compiler on 'simple' mode. This reduces the size to 25% of the uncompressed version.
The JavaScript version has no dependencies. It works in Netscape 4, Internet Explorer 5.5, and all browsers released since the year 2000 (the limiting factor is the use of the encodeURI function).
Save the above as an HTML file in the javascript directory, then open the file in any web browser.
Tests
Unit tests can be performed by pointing a web browser at javascript/tests/diff_match_patch_test.html. Over a hundred tests should run, with zero failures.
Speed test for diff can be performed by pointing a web browser at javascript/tests/speedtest.html and pressing "Compute Diff".