Neurological Phenomenon Multiplexer
Need private packages and team management tools?Check out npm Teams »

variable-diff

2.0.1 • Public • Published

variable-diff

Visual diff between 2 javascript variables. Shows only the difference and ignores keys that are the same. Diff is formatted in an easy to read format.

Build Status

Screenshot

Use

npm install variable-diff
var diff = require('variable-diff');
 
var defaultOptions = {
  indent: '  ',
  newLine: '\n',
  wrap: function wrap(type, text) {
    return chalk[typeColors[type]](text);
  },
  color: true
};
 
var result = diff({ a: 1, b: 2, d: 'hello' }, { a: 8, b: 2, c: 4}, defaultOptions);
console.log(result.text);

Test

npm test

Install

npm i variable-diff

DownloadsWeekly Downloads

28,446

Version

2.0.1

License

MIT

Unpacked Size

22.9 kB

Total Files

7

Last publish

Collaborators

  • avatar