{"_id":"diff-frag","_rev":"4-235c5ec187caee399c3675d746827f6a","name":"diff-frag","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"diff-frag","version":"1.0.0","description":"Take a big diff with a 2-line header and turn it into frags with only a reasonable amount of context","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.9.2"},"funding":{"url":"https://github.com/sponsors/isaacs"},"gitHead":"ec08ed829c1ad1db60559cb609c93139b122b85c","_id":"diff-frag@1.0.0","_nodeVersion":"12.12.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-1DqVT8BlsGYXAH1YCsMkW14n2YUjic/3p20jsBoTZC6B5Bm5XzXVFo8JldLV4meRK4nwk36JaMULIlLviqn0ow==","shasum":"de3405b09be58d744db3d8d749b5a849ed8f0721","tarball":"https://registry.npmjs.org/diff-frag/-/diff-frag-1.0.0.tgz","fileCount":18,"unpackedSize":204550,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1jBSCRA9TVsSAnZWagAAS0wP/2bUQaK+hrR59MYB0DFZ\nwA73RT3vFY0FTh3ZJMo3QHDmdhXXkoi4m1dipJnci+AdIObbZLI4iUTe2brI\nrH20Iv2gr/5JPSc9tW24Yqjn4M4mXgugvJTcRllsg/5rvrFEBBp0UBQYDggk\nmkavztYo1HwSOTw8zyONhyQfJiPPSIjJY+5umzlqjO/KIf9rJ5zpPf2y7nd6\nqkCra5AktIAlCn9Puos4qilZ6eiCduEMgUSA3bp3vL4vHM2BPXYrDtfHER5F\nFZACPMcbvaYRcEuAV0bKeNlCh5q8JQK+V1UAL0cxfRCwnyYrRi1dory/q9tF\nCduQsZLAnRbV01iF75VPRwKg4D7wDSRRLAC4nlkJb9e1zItJuhb1cfNEST3j\n/wLXbidg8mbM59lQmILqT1opIoq/DdaserLLzKUmrPjbycjIaM60Zm7cFhLT\nosO4KUeRhoN/r1sNDjfM7Ps/d9tv9aN5a+Q9yIFo0wKFSNmQpAlocLw9Ju3R\nmmHxiIJIBhG+EwPyn6dIW+xgtixETXOlsiFf7THDcLLfa6iOCB4S3eNSoffn\nsbi27R3MK1mDUQo4d0YTjmPAi0KrSeqO9h8IlUYXvFtzzFR8uP2ORkQggEss\nYLULkl06eXBgZO7L+pmoA4nTT25zeFeRBnx59xS0TNarJPq/evhThYmBLWBq\n0ggZ\r\n=5GcC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBGSeWKomO94UE5SxdSKCs1HcofxHLmrRyKob7mQJ7w1AiBbo/b8dU1pLWp/D6Vws1Cvp427g2vbb/UG8mHBlvJDXQ=="}]},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diff-frag_1.0.0_1574318162341_0.5731649720389702"},"_hasShrinkwrap":false},"1.0.1":{"name":"diff-frag","version":"1.0.1","description":"Take a big diff with a 2-line header and turn it into frags with only a reasonable amount of context","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"test":"tap","preversion":"npm test","postversion":"npm publish","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.9.2"},"funding":{"url":"https://github.com/sponsors/isaacs"},"gitHead":"8a018258c21b8e7074d6631b412956c84ec31295","_id":"diff-frag@1.0.1","_nodeVersion":"12.12.0","_npmVersion":"6.13.1","dist":{"integrity":"sha512-6/v2PC/6UTGcWPPetb9acL8foberUg/CtPdALeJUdD1B/weHNvzftoo00gYznqHGRhHEbykUGzqfG9RWOSr5yw==","shasum":"a7bb51789743e8c0b40e2509166bd155e5833826","tarball":"https://registry.npmjs.org/diff-frag/-/diff-frag-1.0.1.tgz","fileCount":4,"unpackedSize":5093,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1jCzCRA9TVsSAnZWagAAdvUQAJ2DUmMfPAiViflYBbn0\nx6bLiOonfulg5PmAWvUBKabv7GwQ0dqtCjxKeZGC7tqRrxBwK62UWUBlJ8Lh\nuwuNPLqnRt69kGMtZSCmPSuI8Mbfn9YXAVm0z5hYlR2Kgg3MetlSIBw+8nE+\nlbTx6zHZ0vASE0Nm7SNFYvUWkWJIXKImDGpp9de1qJkTlBWlHo4rNfnryV9M\nJ6Qz5W7LRk0gjdHZFMVZ2tAbVc93idgRkPfAofoM4KxiM/JAEMQ2uUgEUMoZ\nYkKREOdOY93Y0nCbe/DzamtDnE6BH7Waho+Ox+nTO3/O+7KUS+4MUW4m/BnT\nX644uAC/QvpneL86UWq/xG5ZrfUzEqGtGmCl4rfZ0puoaDrHJmivKcMgJGCj\nYjAy0YuaMGO0AnLrs3c6GS7fXI0Ee33KlpsHn/X6I56agNsr288gBebnQFAQ\nLoyUzsTOcOnENJpSDwsMrN9FWs6FDLuP9JUo5aF3Y7mGIzLBApJipeS76jOD\nFT4T7PHQD04X7A7LgV8HfproAF50bixy860SZ4cBTBrOCR4mqiYL06SOwxNw\nL8TifKtHHNFS5oybed6Fjipc+dFIMynQjmEKuIx2f4ruDhICN7Xy2Zk2sKpp\nDO+a0DtaSlxpr0O8SXUiPT7ko5E2ZXjEVfcbJhjns9sczagVXii4QK+/Ns/Y\n6u82\r\n=f9OI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrZKxZ0NnmVufFmTJQHvudrUJllgThJc6P9MGiBkL/8QIhAL6WZV1ohlVNyKglPeF+BRq+p0phXlsXBDAmkYSvM0Yn"}]},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diff-frag_1.0.1_1574318259189_0.9084394099490205"},"_hasShrinkwrap":false},"1.1.0":{"name":"diff-frag","version":"1.1.0","description":"Take a big diff with a 2-line header and turn it into frags with only a reasonable amount of context","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"snap":"tap","test":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.9.2"},"funding":{"url":"https://github.com/sponsors/isaacs"},"engines":{"node":">=10"},"gitHead":"bb2a1b2a651f7d511a09346496405792eab4d0b0","_id":"diff-frag@1.1.0","_nodeVersion":"15.3.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-TK/86gBR/FkOmBNKTmeW4j6U14HARzDHzgqLBXZDFJsQ6i8seMUhSxtxfTPNECiIu353EG3wr/CN8aiUgPPHQQ==","shasum":"35d8d76f1331a1c2ac29f98b44f6ca9a470c1be5","tarball":"https://registry.npmjs.org/diff-frag/-/diff-frag-1.1.0.tgz","fileCount":4,"unpackedSize":10117,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZMUHCRA9TVsSAnZWagAAwxsP/3kEbO0O1ISd5zdkAKWJ\nMOUp5R2xVNzITP7Y3+qUg9mqCoXicjXfhYe8xcebaKQYKH5fobCZUuNr39lq\nFT4YjwZAYTWiwoeJeLUogr18EhF6ZK2v4E/YgVU6iAREEKw6kBfq3rAp33Mk\nGKD505o14JBZ9GWtVdVCQS3NNtYQuAfMfay4Sa/wxmlq7FWi2KhyFxhP3LHC\nTIQCA9WUIGS+y4qlJTxGMCtPnoP1lbF7gIHwBYUyJ9w/RpIB/X/9BOLprx0V\n1ljGH3aXc2i0lm5BdCZJEEhMCBNtx62CqWX/EVx2Sj/gwafA02fEzh+cCw/j\nBCT5PP9gNyJFUTt0AsvfgJzsGCvdExx8KR5xmqgQFMrSgOuc4LZvU8F6wUTx\nmNtUwwnvQbxuIGt+TWXIr3KOypuST2v5+LH8XYTLXUtmHYN8z0SOfN1jgiAt\nQjh26ODe7F/mxxokt6KgYmAYWp1pnIOaYF2gP7VKOsV3xmOf4UCrLHlPZJp7\nS3PfPtgY5iR/ZGk0JxbvNyulc0Mb750kcpw+nc6TFnCTA7tbRnmFPqx8oPXD\n3/PgY3HjNnlLlFyqiQOuDQhHKf6EW2GR24ZEyZr20qMQK/sAR/AS5S8MCG4/\nQL59XX+gOercXymDxMrleFgDkUzWKcSdywcfjLbTZ4a108ZfdRJH5ozcV20E\nOEul\r\n=/K+I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC9byJt38hv9IsiIK5uE9itrv2wsi8uQjTAw+M5xwQ1sAiEAlJNKYnHeUrxaz7ujSXFiBcoioexOcJ8zT3PPBoz+R1o="}]},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diff-frag_1.1.0_1617216775476_0.7052838969252331"},"_hasShrinkwrap":false},"1.1.1":{"name":"diff-frag","version":"1.1.1","description":"Take a big diff with a 2-line header and turn it into frags with only a reasonable amount of context","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","scripts":{"snap":"tap","test":"tap","preversion":"npm test","postversion":"npm publish","prepublishOnly":"git push origin --follow-tags"},"tap":{"check-coverage":true},"devDependencies":{"tap":"^14.9.2"},"funding":{"url":"https://github.com/sponsors/isaacs"},"engines":{"node":">=10"},"gitHead":"ed00e61d4face4e724636b4743f32ca1c4e6dc47","_id":"diff-frag@1.1.1","_nodeVersion":"15.3.0","_npmVersion":"7.7.6","dist":{"integrity":"sha512-y0YLhUGviNXaypPimkzmOCaZf8ruocRb+dpOL/lfoicxBua2gkExddlbWxIP56Z5BpSg4gL5sAWhBN2iQm4HVQ==","shasum":"3f4f00e16dc55e283cc2ed9fe1487d1abed76bde","tarball":"https://registry.npmjs.org/diff-frag/-/diff-frag-1.1.1.tgz","fileCount":4,"unpackedSize":10186,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZMszCRA9TVsSAnZWagAAuIsP/3V4HrRk4Pe8ZuXzan9L\nCXIqeWq+Il3eO/Szfe/XhU7cVRdrKFFHgQY6yCgCRR4Rv4dUiCRj+O0bqD+d\n1kFzi3hgPD/WfhVhgCHonBAn7fPn9RBnX7CoIk4/ZPqCCqiVzbnpue9MIz6p\nMZgWsRvxkL41tKriowrQI22KnzHtFkZcdioBLh3NERXCiw3xevUZo+N/9XGk\nj1ipRwLUe63kI2PRzyOrBahmFquOdSsk1MWHLjq/ruSyv/3OMdQ95KHWD/RH\nkJviEHj9l5iNk9Cp8REl3LN8t8Z8HlAVn2LkVM8dqG02kyhCEtSyzgmzA9SQ\nkysJRTNadbeOVHgKT3oEamz50UQj1zyPdEpliO8qe6plL18talExgH+9YAxr\nWtv26RZ9HBKy0OqfSBvWIG9BhRdZ7i5E3VmMn+EK98UwUyyhSZXDyCtWG/p/\nbUvrESNsy44Fb5Dxl3AeeL0envjk64+QQslB80peVQkwdp25wcrHLX78+zCa\nqTgBGhtGssqgbg62bNP4fbR0ILJSU0xBjScHpHZSKBE4trsclFEMb1TcMYOh\nOynLM4vnYVvuT3UTCwkHi0P2RbUvTvj1wM5ERS3M53hSYabDg+we0xg5thCl\n5aiVc1TdtAcjaKohk+FoWrN7GNStGSsfQ7TLijvQr1SiTUX0DWryw5SwEZjf\n77kU\r\n=Gs92\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAREVWVl1kLmhEfpf+AS+Zhv0yXOcn4LkzkhcXN93ehTAiANtGMccPYczDY0oIjhm57/sD19fJhZSC6XnaUDeo2XYg=="}]},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/diff-frag_1.1.1_1617218354742_0.019324973054328565"},"_hasShrinkwrap":false}},"time":{"created":"2019-11-21T06:36:02.340Z","1.0.0":"2019-11-21T06:36:02.483Z","modified":"2022-04-28T12:45:17.276Z","1.0.1":"2019-11-21T06:37:39.405Z","1.1.0":"2021-03-31T18:52:55.623Z","1.1.1":"2021-03-31T19:19:14.918Z"},"maintainers":[{"name":"isaacs","email":"i@izs.me"}],"description":"Take a big diff with a 2-line header and turn it into frags with only a reasonable amount of context","author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"https://izs.me"},"license":"ISC","readme":"# diff-frag\n\nTake a big diff with or without a 2-line header and turn it into frags with\nonly a reasonable amount of context\n\nFor example, you might have a program that spits out a diff like this:\n\n```diff\nsome header data\nAuthor: Bobo The Cat <bobo@cat.kitty>\nDate: Wed Nov 20 20:13:08 2019 -0800\n\ndiff --git a/bowl.txt b/bowl.txt\nindex glorp..prolg 100655\n--- a/bowl.txt\n+++ b/bowl.txt\n space-prefixed lines are the same in both\n but we were sloppy in what got included in the diff\n\n this can happen if you tell git to output a LOT of context, or if you\n have a program that diffs objects in a naive way.\n\n so you get 1000 lines of identical output ...\n\n but dumping that all to ta teerminal is so ruuuuuude\n\n-what you want\n+what you want is just this bit\n+ just the changes\n\n more more more more more.... it goes on and on for a long time...\n```\n\nIn that case, what you'd really prefer is something like:\n\n```diff\nsome header data\nAuthor: Bobo The Cat <bobo@cat.kitty>\nDate: Wed Nov 20 20:13:08 2019 -0800\n\ndiff --git a/bowl.txt b/bowl.txt\nindex glorp..prolg 100655\n--- a/bowl.txt\n+++ b/bowl.txt\n@@ -1000,6 +1000,7 @@ so you get 1000 lines of identical...\n\n but dumping that all to ta teerminal is so ruuuuuude\n\n-what you want\n+what you want is just this bit\n+just the changes\n\n more more more more more.... it goes on and on for a long time...\n@@ -2456,5 +2567,5 @@ another bit of context here\n\n+ added line\n+ well, you get\n- removed line\n- the idea\n\n just the changes, is what I'm saying, not the 1000 lines between.\n```\n\nThis function will take the first kind of string, and turn it into the\nsecond.  It's useful for [test frameworks](https://node-tap.org) that\npretty-print object diffs, for object matching assertions, and want to make\nthem prettier when the object is really big.\n\n## USAGE\n\n```js\nconst diffFrag = require('diff-frag')\n// options are optional, you don't have to pass that in\nconst fraggedDiff = diffFrag(rawDiff, options)\n// that's it, it's just the one function\n```\n\n## OPTIONS\n\n* `contextLines` How many lines of context to show?  Default = 3\n* `hasHeader` Set to `true` to indicate that there is a header separated by\n  `--- oldName\\n+++ newName\\n` lines.  Set to `false` to indicate that\n  you're definitely only sending just the `+/-/' '`-prefixed diff parts.\n  Leave it as the default `null` to tell diffFrag to try to figure it out.\n* `oldName` Only relevant if the header can't be found, otherwise it'll use\n  the oldName in the header that the diff already has.\n* `oldHeader` Only relevant if the header can't be found, otherwise it'll\n  use the oldHeader in the header that the diff already has.\n* `newName` Only relevant if the header can't be found, otherwise it'll use\n  the newName in the header that the diff already has.\n* `newHeader` Only relevant if the header can't be found, otherwise it'll\n  use the newHeader in the header that the diff already has.\n\nA `---/+++` header is always attached to the diff it returns.  If a header\nis found in the diff you provide, then it'll use the names it finds,\notherwise it's generated as:\n\n```js\n`---${oldName}\\t${oldHeader}\\n+++${newName}\\t${newHeader}`\n```\n","readmeFilename":"README.md"}