diff-lines

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

This package is no longer maintained.
Last updated 10 years ago by farskipper .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install diff-lines 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.1                                ...           latest (7 years ago)

3 Versions

  • 1.1.1 [deprecated]           ...           7 years ago
  • 1.1.0 [deprecated]           ...           10 years ago
  • 1.0.0 [deprecated]           ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |