-
Notifications
You must be signed in to change notification settings - Fork 1
/
package.json
68 lines (68 loc) · 3.59 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
"name": "domhandler",
"version": "2.2.0",
"description": "handler for htmlparser2 that turns pages into a dom",
"main": "index.js",
"directories": {
"test": "tests"
},
"scripts": {
"test": "mocha -R list && jshint index.js test/"
},
"repository": {
"type": "git",
"url": "git://github.com/fb55/domhandler.git"
},
"keywords": [
"dom",
"htmlparser2"
],
"dependencies": {
"domelementtype": "1"
},
"devDependencies": {
"htmlparser2": "3.2",
"mocha": "1",
"jshint": "~2.3.0"
},
"author": {
"name": "Felix Boehm",
"email": "me@feedic.com"
},
"jshintConfig": {
"quotmark": "double",
"trailing": true,
"unused": true,
"undef": true,
"node": true,
"proto": true,
"globals": {
"it": true
}
},
"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",
"bugs": {
"url": "https://github.com/fb55/domhandler/issues"
},
"homepage": "https://github.com/fb55/domhandler",
"_id": "domhandler@2.2.0",
"dist": {
"shasum": "ac9febfa988034b43f78ba056ebf7bd373416476",
"tarball": "http://registry.npmjs.org/domhandler/-/domhandler-2.2.0.tgz"
},
"_from": "domhandler@2.2",
"_npmVersion": "1.3.15",
"_npmUser": {
"name": "feedic",
"email": "me@feedic.com"
},
"maintainers": [
{
"name": "feedic",
"email": "me@feedic.com"
}
],
"_shasum": "ac9febfa988034b43f78ba056ebf7bd373416476",
"_resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.2.0.tgz"
}