{
  "name": "diff",
  "version": "1.0.8",
  "description": "A javascript text diff implementation.",
  "keywords": [
    "diff",
    "javascript"
  ],
  "maintainers": [
    {
      "name": "Kevin Decker",
      "email": "kpdecker@gmail.com",
      "url": "http://incaseofstairs.com"
    }
  ],
  "bugs": {
    "url": "http://github.com/kpdecker/jsdiff/issues",
    "email": "kpdecker@gmail.com"
  },
  "licenses": [
    {
      "type": "BSD",
      "url": "http://github.com/kpdecker/jsdiff/blob/master/LICENSE"
    }
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/kpdecker/jsdiff.git"
  },
  "engines": {
    "node": ">=0.3.1"
  },
  "main": "./diff",
  "scripts": {
    "test": "node_modules/.bin/mocha test/*.js"
  },
  "dependencies": {},
  "devDependencies": {
    "mocha": "~1.6",
    "should": "~1.2",
    "colors": "~0.6.2"
  },
  "optionalDependencies": {},
  "files": [
    "diff.js"
  ],
  "readme": "# jsdiff\n\n[![Build Status](https://secure.travis-ci.org/kpdecker/jsdiff.png)](http://travis-ci.org/kpdecker/jsdiff)\n\nA javascript text differencing implementation.\n\nBased on the algorithm proposed in\n[\"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927).\n\n## Installation\n\n    npm install diff\n\nor\n\n    git clone git://github.com/kpdecker/jsdiff.git\n\n## API\n\n* `JsDiff.diffChars(oldStr, newStr)` - diffs two blocks of text, comparing character by character.\n\n    Returns a list of change objects (See below).\n\n* `JsDiff.diffWords(oldStr, newStr)` - diffs two blocks of text, comparing word by word.\n\n    Returns a list of change objects (See below).\n\n* `JsDiff.diffLines(oldStr, newStr)` - diffs two blocks of text, comparing line by line.\n\n    Returns a list of change objects (See below).\n\n* `JsDiff.diffCss(oldStr, newStr)` - diffs two blocks of text, comparing CSS tokens.\n\n    Returns a list of change objects (See below).\n\n* `JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)` - creates a unified diff patch.\n\n    Parameters:\n    * `fileName` : String to be output in the filename sections of the patch\n    * `oldStr` : Original string value\n    * `newStr` : New string value\n    * `oldHeader` : Additional information to include in the old file header\n    * `newHeader` : Additional information to include in thew new file header\n\n* `JsDiff.applyPatch(oldStr, diffStr)` - applies a unified diff patch.\n\n    Return a string containing new version of provided data.\n\n* `convertChangesToXML(changes)` - converts a list of changes to a serialized XML format\n\n### Change Objects\nMany of the methods above return change objects. These objects are consist of the following fields:\n\n* `value`: Text content\n* `added`: True if the value was inserted into the new string\n* `removed`: True of the value was removed from the old string\n\nNote that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner.\n\n## Examples\n\nBasic example in Node\n\n```js\nrequire('colors')\nvar jsdiff = require('diff');\n\nvar one = 'beep boop';\nvar other = 'beep boob blah';\n\nvar diff = jsdiff.diffChars(one, other);\n\ndiff.forEach(function(part){\n  // green for additions, red for deletions\n  // grey for common parts\n  var color = part.added ? 'green' :\n    part.removed ? 'red' : 'grey';\n  process.stderr.write(part.value[color]);\n});\n\nconsole.log()\n```\nRunning the above program should yield\n\n<img src=\"images/node_example.png\" alt=\"Node Example\">\n\nBasic example in a web page\n\n```html\n<pre id=\"display\"></pre>\n<script src=\"diff.js\"></script>\n<script>\nvar one = 'beep boop';\nvar other = 'beep boob blah';\n\nvar diff = JsDiff.diffChars(one, other);\n\ndiff.forEach(function(part){\n  // green for additions, red for deletions\n  // grey for common parts\n  var color = part.added ? 'green' :\n    part.removed ? 'red' : 'grey';\n  var span = document.createElement('span');\n  span.style.color = color;\n  span.appendChild(document\n    .createTextNode(part.value));\n  display.appendChild(span);\n});\n</script>\n```\n\nOpen the above .html file in a browser and you should see\n\n<img src=\"images/web_example.png\" alt=\"Node Example\">\n\n**[Full online demo](http://kpdecker.github.com/jsdiff)**\n\n## License\n\nSoftware License Agreement (BSD License)\n\nCopyright (c) 2009-2011, Kevin Decker kpdecker@gmail.com\n\nAll rights reserved.\n\nRedistribution and use of this software in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above\n  copyright notice, this list of conditions and the\n  following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n  copyright notice, this list of conditions and the\n  following disclaimer in the documentation and/or other\n  materials provided with the distribution.\n\n* Neither the name of Kevin Decker nor the names of its\n  contributors may be used to endorse or promote products\n  derived from this software without specific prior\n  written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\nOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/kpdecker/jsdiff/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n",
  "readmeFilename": "README.md",
  "homepage": "https://github.com/kpdecker/jsdiff",
  "_id": "diff@1.0.8",
  "dist": {
    "shasum": "4b30c332b03ea4e69f7912bc14b2039049731894"
  },
  "_from": "diff@~1.0.3",
  "_resolved": "https://registry.npmjs.org/diff/-/diff-1.0.8.tgz"
}
