Code difference view

How can we create an inline code difference instead of using two different text areas as github code difference tool compares the code.
http://cemerick.github.io/jsdifflib/demo.html This library also has the same thing. Here we can get the inline difference.

Do we have this option in code-mirror if yes then how to configure it.

Nope, that’s not something that exists. (It could be built, but I’m not aware of any open implementation.)