{
  "_from": "domhandler@2.2",
  "_id": "domhandler@2.2.0",
  "_location": "/keybase/cheerio/htmlparser2/domhandler",
  "_phantomChildren": {},
  "_requiredBy": [
    "/keybase/cheerio/htmlparser2"
  ],
  "_shrinkwrap": null,
  "author": {
    "email": "me@feedic.com",
    "name": "Felix Boehm"
  },
  "bugs": {
    "url": "https://github.com/fb55/domhandler/issues"
  },
  "dependencies": {
    "domelementtype": "1"
  },
  "description": "handler for htmlparser2 that turns pages into a dom",
  "devDependencies": {
    "htmlparser2": "3.2",
    "jshint": "~2.3.0",
    "mocha": "1"
  },
  "directories": {
    "test": "tests"
  },
  "homepage": "https://github.com/fb55/domhandler",
  "jshintConfig": {
    "globals": {
      "it": true
    },
    "node": true,
    "proto": true,
    "quotmark": "double",
    "trailing": true,
    "undef": true,
    "unused": true
  },
  "keywords": [
    "dom",
    "htmlparser2"
  ],
  "main": "index.js",
  "name": "domhandler",
  "optionalDependencies": {},
  "readme": "#DOMHandler [![Build Status](https://secure.travis-ci.org/fb55/DomHandler.png)](http://travis-ci.org/fb55/DomHandler)\n\nThe DOM handler (formally known as DefaultHandler) creates a tree containing all nodes of a page. The tree may be manipulated using the DOMUtils library.\n\n##Usage\n```javascript\nvar handler = new DomHandler([ <func> callback(err, dom), ] [ <obj> options ]);\n// var parser = new Parser(handler[, options]);\n```\n\n##Example\n```javascript\nvar htmlparser = require(\"htmlparser2\");\nvar rawHtml = \"Xyz <script language= javascript>var foo = '<<bar>>';< /  script><!--<!-- Waah! -- -->\";\nvar handler = new htmlparser.DomHandler(function (error, dom) {\n    if (error)\n    \t[...do something for errors...]\n    else\n    \t[...parsing done, do something...]\n        console.log(dom);\n});\nvar parser = new htmlparser.Parser(handler);\nparser.write(rawHtml);\nparser.done();\n```\n\nOutput:\n\n```javascript\n[{\n    data: 'Xyz ',\n    type: 'text'\n}, {\n    type: 'script',\n    name: 'script',\n    attribs: {\n    \tlanguage: 'javascript'\n    },\n    children: [{\n    \tdata: 'var foo = \\'<bar>\\';<',\n    \ttype: 'text'\n    }]\n}, {\n    data: '<!-- Waah! -- ',\n    type: 'comment'\n}]\n```\n\n##Option: normalizeWhitespace\nIndicates whether the whitespace in text nodes should be normalized (= all whitespace should be replaced with single spaces). The default value is \"false\". \n\nThe following HTML will be used:\n\n```html\n<font>\n\t<br>this is the text\n<font>\n```\n\n###Example: true\n\n```javascript\n[{\n    type: 'tag',\n    name: 'font',\n    children: [{\n    \tdata: ' ',\n    \ttype: 'text'\n    }, {\n    \ttype: 'tag',\n    \tname: 'br'\n    }, {\n    \tdata: 'this is the text ',\n    \ttype: 'text'\n    }, {\n    \ttype: 'tag',\n    \tname: 'font'\n    }]\n}]\n```\n\n###Example: false\n\n```javascript\n[{\n    type: 'tag',\n    name: 'font',\n    children: [{\n    \tdata: '\\n\\t',\n    \ttype: 'text'\n    }, {\n    \ttype: 'tag',\n    \tname: 'br'\n    }, {\n    \tdata: 'this is the text\\n',\n    \ttype: 'text'\n    }, {\n    \ttype: 'tag',\n    \tname: 'font'\n    }]\n}]\n```\n",
  "readmeFilename": "readme.md",
  "repository": {
    "type": "git",
    "url": "git://github.com/fb55/domhandler.git"
  },
  "scripts": {
    "test": "mocha -R list && jshint index.js test/"
  },
  "version": "2.2.0"
}
