git-diff
Returns the git diff of two strings
Usage
npm install --save git-diff
git-diff takes 3 arguments, the first string to diff, the second string to diff and optionally a color flag (boolean)
git-diff returns a string containing the difference
The color flag (defaults to false) indicates whether you want the return value to be colorized with chalk
Examples to demonstrate usage follow.
With color:
var gitDiff = require('git-diff')
var actual = gitDiff('a\nb\n', 'a\nc\n', {color: true})
expect(actual).to.equal('a\n-b\n+c\n')
Without color:
var gitDiff = require('git-diff')
var actual = gitDiff('a\nb\n', 'a\nc\n')
expect(actual).to.equal('a\n-b\n+c\n')
Author says
What's the difference between how God treats the righteous and the wicked?
And God saw that the light was good. And God separated the light from the darkness. Genesis 1:4 ESV
And He will do it again:
Let both grow together until the harvest, and at harvest time I will tell the reapers, “Gather the weeds first and bind them in bundles to be burned, but gather the wheat into my barn.” Matthew 13:30 ESV
Much love :D