How do I compare two different texts and show the differences like in MS Word?

I want to allow users to see the changes they’ve made to form entries. I am storing the before and after versions, but I don’t see how I can visually show the differences. Any suggestions? Is there an NPM package that anyone has successfully used for this? Thanks.