Format text differences of 2 strings

Hi all,
I’m looking for some help in comparing 2 text strings and displaying the differences.
Something very much like what can be seen here:
string1: The quick brown fow jumped over the lazy dog
string2: The big quick brown fox ran over the lazy dog

Result: The quick big brown fo w x jumped ran over the lazy dog

shown much better using this example of diff-match-patch
https://neil.fraser.name/software/diff_match_patch/demos/diff.html

I’ve thought I might just be able to grab the javascript code from https://github.com/google/diff-match-patch
put it into a backend jsw and go from there,
however cant work out how to reference this from my main page and use the functions.

Any ideas or pointers to other options much appreciated.

cheers