JSPM

diff-lines

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13650
  • Score
    100M100P100Q16359F
  • License MIT

Given two strings, show the lines that differ. (similar to `git diff`)

Package Exports

  • diff-lines

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (diff-lines) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

diff-lines

build status

Given two strings, show the lines that differ. (similar to git diff)

var diff = require('diff-lines');

var a = '';
a += 'one\n';
a += 'two\n';
a += 'three\n';

var b = '';
b += 'one\n';
b += 'three\n';
b += 'four\n';

console.log(diff(a, b));

Output:

 one
-two
 three
+four

API

diff(a, b[, options])

  • options.n_surrounding - number of lines surrounding a diff to show. (default -1, show all lines)

License

MIT