colorful diffs for javascript objects
Create colorful diffs for javascript objects.
var difflet = require'difflet'; var s = diffletcompare a : 2 c : 5 a : 3 b : 4 ;processstdoutwrites;
output:

var diff = require'difflet' indent : 2 ; var prev = yy : 6 zz : 5 a : 123 fn : 'beep' c : x : 7 z : 3 ; var next = a : 1 2 "z" /beep/ 3 fn : {} b : 567 c : x : 8 y : 5 ; diffprev nextpipeprocessstdout;
output:

green for inserts, blue for updates, red for deletes
var difflet = require('difflet')
Create a difflet from optional options opts.
With opts.start(type, stream) and opts.stop(type, stream),
you can write custom handlers for all the types of differences:
'inserted', 'updated', and 'deleted'.
By default green is used for insertions, blue for updates, and red for
deletions.
If opts.indent is set, output will span multiple lines and opts.indent
spaces will be used for leading whitespace.
If opts.comma === 'first' then commas will be placed at the start of lines.
Setting opts.comment to true will turn on comments with the previous
contents like this:

Return a stream with the colorful changes between objects prev and next.
Return a string with the colorful changes between prev and next.
Return a string with the colorful changes between prev and next with the
default options.
With npm do:
npm install difflet
With npm do:
npm test
MIT/X11