diff-arrays
v1.0.0
Published
Utility method for finding the difference between arrays, showing which array has which differences
Downloads
72
Readme
Diff Arrays
Utility method to compute the difference between two arrays. AMD and CommonJS compatible; works in Node.js and the browser.
It's fork of array-difference that shows in the output if the
difference is on the left-hand side (lhs
) or right-hand side (rhs
).
Thanks Mike Pennisi for the original.
Installation
$ npm install diff-arrays
Example
var da = require('diff-arrays');
var left = [
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]'
];
var right = [
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]'
];
var diff = da(left, right);
console.log(diff);
Outputs
{ lhs:
[ '[email protected]',
'[email protected]',
'[email protected]' ],
rhs:
[ '[email protected]',
'[email protected]',
'[email protected]' ] }
License
Copyright (c) 2015 Bram Borggreve
Licensed under the MIT license.
Copyright (c) 2013 Mike Pennisi
Licensed under the MIT Expat license.