fake-diff
fake-diff is a tiny Node.js plugin that you can include in your projects. You can install it via following command:
npm install fake-diff
Usage
Simply compare two strings as the first and second argument:
const fakeDiff = console
Example output:
Or you can pass files:
const fs = const fakeDiff = const oldFileContent = fsconst newFileContent = fsconsole
Also takes the following options as an object in the third parameter:
fakeDiff(oldFile, newFile, options)
Option | Type | Default Value |
---|---|---|
hideLines | boolean | true |
maxAdjacentStaticLines | number | 1 |
Credit
Relies on diff (npm package) to generate line diffs, and chalk for coloring.
Alternatives: git-diff (npm package)
License
MIT