Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.