{"_id":"diffy","_rev":"16-f045e968e04efc3f2ccf705383a3a7ea","name":"diffy","description":"A tiny framework for building diff based interactive command line tools.","dist-tags":{"latest":"2.1.0"},"versions":{"0.1.0":{"name":"diffy","description":"Simple diffing tool for json and javascript objects","author":{"name":"Fouad Matin","email":"fm@fouad.co"},"repository":{"type":"git","url":"https://github.com/fouad/diffy.git"},"version":"0.1.0","devDependencies":{"mocha":"1.7.0","which":"1.0.5","supervisor":"0.5.0"},"main":"lib/diffy","_id":"diffy@0.1.0","dist":{"shasum":"f2d69076bf37fdd280b62230a8a83b01a48ed79b","tarball":"https://registry.npmjs.org/diffy/-/diffy-0.1.0.tgz","integrity":"sha512-3ZY4VRebFd6gFL+pqdvQuLkIZefQVAuZQIoS5OjjkkgIsZWFdp3S4fi6HTOBltCDYpqJwB2LgjQtBdTyIpGnng==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfjNmHPKDoy8gkAjguv9alxIu4LuaXRfWO4+uJYq6NZAiB2T7SbVeXZGF7Y00fLWC7fVA/qPL9oRk9CZC9VXEeV6Q=="}]},"_npmVersion":"1.1.69","_npmUser":{"name":"fouad","email":"fm@fouad.co"},"maintainers":[{"name":"fouad","email":"fm@fouad.co"}],"directories":{}},"1.0.0":{"name":"diffy","version":"1.0.0","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.4","neat-input":"^1.4.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"27eb536f2b794c7cb6a7af91b99c96b128ce2128","_id":"diffy@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-gUpztvey145LjS1FB9m+qKIT1CQT4YgTC1131PUYCpIp2GaDWq+h61lRx619K29M94wIzY7+IsQg3Wx6FP8Seg==","shasum":"77e989ea33f98318c1c446dbe28d0d59ac28d492","tarball":"https://registry.npmjs.org/diffy/-/diffy-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0L72ZCVQaQzUVaNriaWCArmTQDszIFKk1Cuwy8cqQ6gIgHbzoQAuDvMnh3jo16P9ozW/JT7RPlR7lVp57fLy2/ak="}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy-1.0.0.tgz_1514411543705_0.7804424399510026"},"directories":{}},"1.0.1":{"name":"diffy","version":"1.0.1","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.4","neat-input":"^1.4.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"b2c2cefdeaaa2227088bf4cf1d83e74314cf7890","_id":"diffy@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-bT2tp487013+DLIsGgEhOUe166d7pCftMJ0cT/oWqdV+zPYho+RxYtCfwfNuYxptfKvZ2VjOgo4FiYKbPLkNxA==","shasum":"7ac21fd40a21067fea14b096b59b374ade10fa9a","tarball":"https://registry.npmjs.org/diffy/-/diffy-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDcf/ahmhPw30kiZs6L0A1C7yJfdqDGAbQlOMcNQgRfmAIhALQDHEPxC/ovZr0wX1JAMmwgtqytr51+rFt/v2YwayPM"}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy-1.0.1.tgz_1514449845970_0.39549562567844987"},"directories":{}},"1.1.0":{"name":"diffy","version":"1.1.0","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.4","neat-input":"^1.4.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"9f547a2bab7f24f6e8eb49c41dd8063e4cf07b26","_id":"diffy@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-OGG4Gnz3umoP/P4svBvptaRZpQF7Y9erQyDr7FeIVSNLb1nPNuijhRb8bAcR0+c00vlMvtbKnm9S9ylvP8f0Qg==","shasum":"621e6215e81f9ced7925d29ff04d4416c43a01c6","tarball":"https://registry.npmjs.org/diffy/-/diffy-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4v6/58S+GOvvtGsD0udMozmZwiT8gn8eRR7VtZ3CQbwIhAN8KrBOvwKOtWifKx50hDv0DYhBFkkvQ/oHX/EiFiyKG"}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy-1.1.0.tgz_1514472150828_0.5278203606139868"},"directories":{}},"1.2.0":{"name":"diffy","version":"1.2.0","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.4","neat-input":"^1.4.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"657acfcead007bd6ab18c2e73749a7eec9153cd9","_id":"diffy@1.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-gNfmtucO4NdKwW/8vienvLKKnjbe6K4ALdjquxwuE2igjMJTHnx4KjnO9NzTNT6Xu1sMYEV1lDNvPkcLivzOIg==","shasum":"e7b5f806988f3a9472fe0701a92741d5d129a34e","tarball":"https://registry.npmjs.org/diffy/-/diffy-1.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGjF2DT/vcpzJxIHy7uETVT+gfCwZxq2ouZqprXbpRqYAiB68QTGLoua90TTzWkY2Y5GJyMzw2oMH8kkIMaqFmIHPg=="}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy-1.2.0.tgz_1514505454063_0.11026554927229881"},"directories":{}},"1.3.0":{"name":"diffy","version":"1.3.0","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.10","neat-input":"^1.5.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"9119f0f892c0e4073f2a261dc73a6120acf9a570","_id":"diffy@1.3.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-N96rgf1U3FtLfRIBnH93R1TXM5gCNPG79vNJCmP1KqYebS4mnOvixZ3hNA9VWPoSpwSeJ0/y3Hx9gNt/IvWyFA==","shasum":"23c07f171128428a13721e0f8102f521bb7b409c","tarball":"https://registry.npmjs.org/diffy/-/diffy-1.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDivxg/U/gXVk1nmKojzZZNbK/1b+hc7FJCcKxRKKm7zAIgPBSa9jX5IGbINQi5/brYkfFU51X/WL8ZspQTEaBTdtI="}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy-1.3.0.tgz_1514546473199_0.7729508904740214"},"directories":{}},"1.3.1":{"name":"diffy","version":"1.3.1","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.10","neat-input":"^1.5.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"a3fb9354e1a7cd504197dc54beab9bc50d0b4181","_id":"diffy@1.3.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-+hxizoBu7feA5SKrZRftzJXJi7ZtM04BFSL01TinlS3jcxCbrE1yWTGEzzbUjxtS6SJTsvvMUmFk6lAP8rk56A==","shasum":"c1a1d8de785699a34e48bc488b5caa13b54ff9ba","tarball":"https://registry.npmjs.org/diffy/-/diffy-1.3.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAVuCmO+hy6BokbVsB4iv5yjHQDgJXT3wttqKKZK4Ot2AiBSLxB4K6lpNilC1KTk+o/J8mmreiip92oEfegzkiixVg=="}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy-1.3.1.tgz_1514563604754_0.4581652954220772"},"directories":{}},"2.0.0":{"name":"diffy","version":"2.0.0","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.10","neat-input":"^1.5.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"206f9a5973f9f0c6a9f00397ba84d3997c7920bf","_id":"diffy@2.0.0","_npmVersion":"5.6.0","_nodeVersion":"9.9.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-T1+MF7chaOtNaBeV59td6lYlci6dCTUraySH8LDltafhd+FLTsYpJJbLVpl6S4ih6kPFMaHSIqQ92bRVvoE+3Q==","shasum":"93785bcfb61e9708e9268b8f98ba622fc346a2b0","tarball":"https://registry.npmjs.org/diffy/-/diffy-2.0.0.tgz","fileCount":14,"unpackedSize":10190,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/4EoVNLI7Out0dzLi+5wQoZwgAkyWqZgQwN1YPgsMwAiEAiUGI3fPlXn6f0oU0PFcr1nT2qAAUw69L3C/IdyyE4WQ="}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy_2.0.0_1522480231533_0.7256421581151193"},"_hasShrinkwrap":false},"2.1.0":{"name":"diffy","version":"2.1.0","description":"A tiny framework for building diff based interactive command line tools.","main":"index.js","dependencies":{"ansi-diff":"^1.0.10","neat-input":"^1.9.0"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"scripts":{"test":"standard"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"homepage":"https://github.com/mafintosh/diffy","devDependencies":{"standard":"^10.0.3"},"gitHead":"82552aea61d65acaa5a149695e4fc4732641508b","_id":"diffy@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-BIo2fEAv3U0YmyuM1XTijwZ/OJjmXnlSvsguQy3LOaz5C2R/vrMy8SCRdQn1iz3KhBJYJzy+918xS/PKY/47lw==","shasum":"bd60140c6fe2e67ab65b5d6b09bf2655db5b41b5","tarball":"https://registry.npmjs.org/diffy/-/diffy-2.1.0.tgz","fileCount":14,"unpackedSize":10191,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcJIUQCRA9TVsSAnZWagAADbIP/0aWCSNqV0BDgSa0XKth\n/vFwPE8rjK2Urxy9KxbAwtvWk8mt2z9DquHuVgFw6w9LGAFePKxV3G7DEjb9\nmFXW+TDR01/+nawdptXRNn2wi+9CJ+K/KjQUKGd+gSgMo8r8HTTjyyc19Hpi\nV7dDZLyHqm0Q+EpDKabaL8he2VbJGlQmWInzG4XSybiMAs3YC2ANWzHX8kMX\nNdC7n4hq8oIIa9AbbSS6ciYZhtax26htP2sleRMgNGPAP5V40oVygIpSyEq1\nv9yx1jQUvijoVYXxIlB8f4j9kZBzJ8AkOXv7uAwOYMQrzDTmKABiBZnh1Jns\nLCO8hg9/lHgfOnWCBFcjtKZ6vuzwOzttYHhABD1Em2b5RL1QhlB1jiLQ+6+R\neCz0MuQmumdHBxMEStRx6ivddGMTGlpvjsDsIt7oTgosW6bMUiq+QJrzSal8\nA6t7q21fmZ7Rt8TM778/VLFjEJFZhpB7NlQvznwwujyp2jZa1hPvZ1g7PLkD\nY0BWYj4M1YFGpEtcBPa2Dds9pgqJvVyJqfdSmJ3VgoDe/VAECMjYPwHUll++\nwRJ+r3DeOWM/QaHsU1mFmrks4YF9RVjPK02091lctpF/Ow7pDblqATiLsIQC\nkCrUihY/cXYQ6B+BQmHag4PdZJMM10h70zJqCVusE3Q/d2pTsDgVnjIwwRlu\n4Xgs\r\n=LT5y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGKpmWL17inrd9BypQciIiwZRHtkSdGUIxo5NAHXOjrlAiBPv9UbJOlPPe/2yB1GZbVxDSL9uX28TWofN8UdYjhxcQ=="}]},"maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diffy_2.1.0_1545897231681_0.9281226840459018"},"_hasShrinkwrap":false}},"readme":"# diffy\n\nA tiny framework for building diff based interactive command line tools.\n\n```\nnpm install diffy\n```\n\n[![Build Status](https://travis-ci.org/mafintosh/diffy.svg?branch=master)](https://travis-ci.org/mafintosh/diffy)\n\nBasically React, but in the terminal powered by [ansi-diff](https://github.com/mafintosh/ansi-diff) and [neat-input](https://github.com/mafintosh/neat-input).\n\n## Usage\n\n``` js\nvar diffy = require('diffy')()\nvar trim = require('diffy/trim')\n\ndiffy.render(function () {\n  return trim(`\n    Hello user. The time is:\n      ${new Date()}\n    That is all for now\n  `)\n})\n\n// re-render every 1s\nsetInterval(() => diffy.render(), 1000)\n```\n\nYou can also use `diffy` to query input from a user\n\n``` js\nvar diffy = require('diffy')()\nvar trim = require('diffy/trim')\nvar input = require('diffy/input')({style: style})\nvar names = []\n\ninput.on('update', () => diffy.render())\ninput.on('enter', (line) => names.push(line))\n\ndiffy.render(function () {\n  return trim(`\n    Enter your name: ${input.line()}\n    List of names: ${names.join(', ')}\n  `)\n})\n\nfunction style (start, cursor, end) {\n  return start + '[' + (cursor || ' ') + ']' + end\n}\n```\n\nSee the examples folder for more.\n\n## API\n\n#### `var diffy = require('diffy')([options])`\n\nMake a new diffy instance. Writes to stdout.\n\nOptions include:\n\n``` js\n{\n  fullscreen: true // overtake the terminal like vim/less does\n}\n```\n\nNote that if you use `fullscreen: true`, the terminal will be restored\non exit, even if your program crashes.\n\n#### `diffy.render([function])`\n\nTrigger a render and/or update the default render\nfunction. A render function should simply return a string\ncontaining the output you wish to display and then `diffy` will make sure to only print the diff.\n\n#### `diffy.width`\n\nProperty containing the width of the terminal.\n\n#### `diffy.height`\n\nProperty containing the height of the terminal.\n\n#### `diffy.on('resize')`\n\nEmitted when the terminal is resized. Triggers a render as well.\n\n#### `diffy.on('render')`\n\nEmitted just before a render happens.\n\n#### `var input = require('diffy/input')()`\n\nGet a [neat-input](https://github.com/mafintosh/neat-input) instance. Use this if you want to accept interactive input.\n\n#### `var trim = require('diffy/trim')`\n\nHelper function that trims and removes the indentation of a multiline string. Useful if you have a render function that returns an indented string like in the above example.\n\n#### `var trim = require('diffy/trim+newline')`\n\nHelper function that trims but adds a newline at the end\n\n## Components\n\nWith diffy, components are just strings you compose together to form your application.\nA bunch of modules already exists for this pattern, providing useful features.\n\n* [watson/menu-string](https://github.com/watson/menu-string) - Generate a menu with selectable menu items as a string.\n* [watson/progress-string](https://github.com/watson/progress-string) - Generate a CLI progress bar as a string that you can then output in any way you like.\n* [mafintosh/scrollable-string](https://github.com/mafintosh/scrollable-string) - Generate a diff friendly string that is bounded by a configurable scroll box.\n\n## Credits\n\nThank you to [@Fouad](https://github.com/Fouad) for donating the module name.\n\n## License\n\nMIT\n","maintainers":[{"email":"mathiasbuus@gmail.com","name":"mafintosh"}],"time":{"modified":"2022-06-15T03:48:42.750Z","created":"2013-01-27T18:34:41.486Z","0.1.0":"2013-01-27T18:34:42.294Z","1.0.0":"2017-12-27T21:52:24.765Z","1.0.1":"2017-12-28T08:30:46.945Z","1.1.0":"2017-12-28T14:42:31.793Z","1.2.0":"2017-12-28T23:57:34.997Z","1.3.0":"2017-12-29T11:21:14.334Z","1.3.1":"2017-12-29T16:06:45.735Z","2.0.0":"2018-03-31T07:10:31.589Z","2.1.0":"2018-12-27T07:53:51.893Z"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/diffy.git"},"readmeFilename":"README.md","homepage":"https://github.com/mafintosh/diffy","bugs":{"url":"https://github.com/mafintosh/diffy/issues"},"license":"MIT"}