{"name":"difflet","description":"colorful diffs for javascript objects","version":"1.0.1","repository":{"type":"git","url":"git://github.com/substack/difflet.git"},"main":"index.js","keywords":["diff","object","compare"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tap test/*.js"},"dependencies":{"traverse":"0.6.x","charm":"0.1.x","deep-is":"0.1.x"},"devDependencies":{"tap":"0.1.x","ent":"0.0.x"},"engines":{"node":">=0.4.0"},"license":"MIT","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"gitHead":"91493b0f7c49abb660467c0878be58e8b2561053","bugs":{"url":"https://github.com/substack/difflet/issues"},"homepage":"https://github.com/substack/difflet#readme","_id":"difflet@1.0.1","_shasum":"189f8f9039e4ee4ac3ea943d4de66d259965b13c","_from":".","_npmVersion":"3.4.1","_nodeVersion":"4.2.1","_npmUser":{"name":"substack","email":"substack@gmail.com"},"dist":{"shasum":"189f8f9039e4ee4ac3ea943d4de66d259965b13c","tarball":"http://registry-npm.ywwl.com/difflet/download/difflet-1.0.1.tgz","integrity":"sha512-M5odUun54PsYRWAVCUOTF975cuQN1MBYgi46lxZ+00X7A0wbkJTp+1zyr979lVpRS/gOMpekqhDMlBKmP2oXjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDcAULVwOsPm5G65bQMXHUX+Fys6Vk4ad9EofaFNZpzdAiEAnx81A9MJgWBewxNDo4W8aWJBzhleuX0HY95DmhDIfoI="}],"size":6055,"noattachment":false,"key":"/difflet/-/difflet-1.0.1.tgz"},"maintainers":[{"name":"substack","email":"mail@substack.net"}],"readme":"difflet\n=======\n\nCreate colorful diffs for javascript objects.\n\nexample\n=======\n\nstring.js\n---------\n\n``` js\nvar difflet = require('difflet');\n\nvar s = difflet.compare({ a : 2, c : 5 }, { a : 3, b : 4 });\nprocess.stdout.write(s);\n```\n\noutput:\n\n![colorful output](http://substack.net/images/screenshots/difflet_string.png)\n\ncolors.js\n---------\n\n``` js\nvar diff = require('difflet')({ indent : 2 });\n\nvar prev = {\n    yy : 6,\n    zz : 5,\n    a : [1,2,3],\n    fn : 'beep',\n    c : { x : 7, z : 3 }\n};\n\nvar next = {\n    a : [ 1, 2, \"z\", /beep/, new Buffer(3) ],\n    fn : function qqq () {},\n    b : [5,6,7],\n    c : { x : 8, y : 5 }\n};\n\ndiff(prev, next).pipe(process.stdout);\n```\n\noutput:\n\n![colorful output](http://substack.net/images/screenshots/difflet_colors.png)\n\ngreen for inserts, blue for updates, red for deletes\n\nmethods\n=======\n\nvar difflet = require('difflet')\n\nvar diff = difflet(opts={})\n---------------------------\n\nCreate a difflet from optional options `opts`.\n\nWith `opts.start(type, stream)` and `opts.stop(type, stream)`,\nyou can write custom handlers for all the types of differences:\n`'inserted'`, `'updated'`, and `'deleted'`.\nBy default green is used for insertions, blue for updates, and red for\ndeletions.\n\nIf `opts.indent` is set, output will span multiple lines and `opts.indent`\nspaces will be used for leading whitespace.\n\nIf `opts.comma === 'first'` then commas will be placed at the start of lines.\n\nSetting `opts.comment` to `true` will turn on comments with the previous\ncontents like this:\n\nSetting `opts.deepEqual` allows a different equality function to be used. By default\n[deep-is](https://npmjs.org/package/deep-is) is used.\n\n![object comments](http://substack.net/images/screenshots/difflet_object_comments.png)\n\ndiff(prev, next)\n----------------\n\nReturn a stream with the colorful changes between objects `prev` and `next`.\n\ndiff.compare(prev, next)\n------------------------\n\nReturn a string with the colorful changes between `prev` and `next`.\n\ndifflet.compare(prev, next)\n---------------------------\n\nReturn a string with the colorful changes between `prev` and `next` with the\ndefault options.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install difflet\n```\n\ntest\n====\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm test\n```\n\nlicense\n=======\n\nCopyright (C) 2012, 2013 James Halliday <mail@substack.net>\n\nLicensed under the MIT license, see LICENSE for details.\n","publish_time":1451702102548,"_cnpm_publish_time":1451702102548,"dist-tags":{"latest":"1.0.1"}}