Compare two string and generate human-friendly output to stdout (based on git-split-diffs)
npm i string-diff-viewer
const { diff, format } = require( 'string-diff-viewer' )
;( async () => {
const diffs = await diff( oldStr, newStr )
console.log( await format( diffs ) )
} )()
- git-split-diffs - GitHub style split diffs in your terminal
MIT