Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleclarson/changed-lines
Compare strings just like `git diff` does
https://github.com/aleclarson/changed-lines
comparison git-diff isomorphic javascript string
Last synced: 19 days ago
JSON representation
Compare strings just like `git diff` does
- Host: GitHub
- URL: https://github.com/aleclarson/changed-lines
- Owner: aleclarson
- License: mit
- Created: 2018-05-21T16:22:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-12-05T16:57:08.000Z (almost 6 years ago)
- Last Synced: 2024-05-01T22:24:01.313Z (6 months ago)
- Topics: comparison, git-diff, isomorphic, javascript, string
- Language: JavaScript
- Homepage:
- Size: 1.95 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# changed-lines v1.0.0
Compare strings just like `git diff` does! 😎
Thanks to the amazing [diff-sequences][1] package. 😇
[1]: https://www.npmjs.com/package/diff-sequences
```js
const diff = require('changed-lines');// The result is an array.
let res = diff(input, output);// Optional ansi colors.
const chalk = require('chalk');
res = diff(input, output, {
green: chalk.green,
red: chalk.red,
});
```The `input` and `output` values can be a string or array of strings.