{"name":"domino","version":"2.1.2","license":"BSD-2-Clause","author":{"name":"Felix Gnass","email":"fgnass@gmail.com"},"description":"Server-side DOM implementation based on Mozilla's dom.js","homepage":"https://github.com/fgnass/domino","main":"./lib","repository":{"type":"git","url":"git+https://github.com/fgnass/domino.git"},"scripts":{"lint":"jshint lib test/*.js","mocha":"mocha","mocha-spec":"mocha -R spec","test":"npm run lint && npm run mocha","test-spec":"npm run lint && npm run mocha-spec","regen-html5lib-tests":"node test/tools/update-html5lib-tests.js test/html5lib-tests.json","bump-version":"npm version patch -m 'Release domino %s.' && tools/bump-version.js && npm run version && git add package.json && git commit -m 'Bump version after release.'","version":"tools/update-changelog.js && git add CHANGELOG.md"},"types":"lib/index.d.ts","devDependencies":{"jquery":"^3.3.1","jshint":"^2.9.6","mocha":"^4.1.0","should":"^13.2.1"},"gitHead":"f049cfb7b6417d4076c6e8b8d87a848813be1698","bugs":{"url":"https://github.com/fgnass/domino/issues"},"_id":"domino@2.1.2","_npmVersion":"6.5.0","_nodeVersion":"11.9.0","_npmUser":{"name":"cscott","email":"cscott@cscott.net"},"dist":{"integrity":"sha512-nzg76s4Smji9teyLwOnqqUCdFVOho+OQFqUwp+42Wo+SEZ1FGw7uhemv6OKk2qp8YIgnGB3jVt0sJWU96wbPgA==","shasum":"70e8367839ee8ad8bde3aeb4857cf3d93bd98b85","tarball":"http://registry-npm.ywwl.com/domino/download/domino-2.1.2.tgz","fileCount":1025,"unpackedSize":6649250,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZdLlCRA9TVsSAnZWagAAbRQQAJW+4zQ9CAu/A8oR2Ynm\nAK4418YViSUlPLcc3yKx7SsAsQBUMomFeSIIRktfyR2BG3BUSXvRhFBj3myR\nRonPkOKiEtZnEaKYwQtrVkgx4cXm9GhR/IecMG8gYqgxciSm3uLRr3hjC67l\nv5iWTOqMBkH/Y9xsKTnXStcX1tpL86kg4RG/q4RyIEnaZ9iSQq3nZXovkIVf\nqxrjkpvDTo+MkRVnrwnhjt+OKDQu5yhMQpQ7kGm0pes2a5e8ZlNO0wO21Dzo\nl17nnmEJLKdnv4O2r/yIp4kOLOTN6dt1fsOrxac4fw48Nkg8ICeKesXzDTgT\nW8KO5xH1a1xHnMjGV/zgNaJdO4nd2BMms2LW4+PSTDB6t+nOvPkM2f97chWz\nbMHXq/pQeAnlVQdymliQUzlvmtqHJGuxxYZ/vjlurHk2Gi/gv5qMiJXGOAsG\noyyBs/HYRYt+BGv8qHNDXZ1DMtSQmPDGjg4OJ3ZQH+uNSgWc5HA1idzusbT1\nh3rRmPFY1G9Fw5a12Yf0OcU3y6InXDlGaYb1rQ43KSsfBZXbcKYujqAkZdJD\n2AQVRcqrLMRqtkcUJx8ucu5RzpxBswRzo+ZyMImrthdviFoYQygocN9gk6Fs\ns6n6JfjJngYVZWGaJGPLokLkDSf7OwPk9xfHZYGaNvP4le9wWj5nizGLH1EM\nK8Jm\r\n=DdZQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCy0Nj67Cgtt3Ufahi6Gf6GXnLNY6IFw9l7BXkuEuag7wIhALrEfs19LliT0njISGsCDOyYti/Dou3GZjvACCLp7eRT"}],"size":615231,"noattachment":false,"key":"/domino/-/domino-2.1.2.tgz"},"maintainers":[{"name":"cscott","email":"cscott@cscott.net"},{"name":"fgnass","email":"fgnass@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/domino_2.1.2_1550176997107_0.9040446241088163"},"_hasShrinkwrap":false,"readme":"# Server-side DOM implementation based on Mozilla's dom.js\n\n[![Build Status][1]][2] [![dependency status][3]][4] [![dev dependency status][5]][6]\n\nAs the name might suggest, domino's goal is to provide a <b>DOM in No</b>de.\n\nIn contrast to the original [dom.js](https://github.com/andreasgal/dom.js) project, domino was not designed to run untrusted code. Hence it doesn't have to hide its internals behind a proxy facade which makes the code not only simpler, but also [more performant](https://github.com/fgnass/dombench).\n\nDomino currently doesn't use any harmony/ES6 features like proxies or WeakMaps and therefore also runs in older Node versions.\n\n## Speed over Compliance\n\nDomino is intended for _building_ pages rather than scraping them. Hence Domino doesn't execute scripts nor does it download external resources.\n\nAlso Domino doesn't generally implement properties which have been deprecated in HTML5.\n\nDomino sticks to [DOM level 4](http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#interface-attr), which means that Attributes do not inherit the Node interface.\n\n<b>Note that</b> because domino does not use proxies,\n`Element.attributes` is not a true JavaScript array; it is an object\nwith a `length` property and an `item(n)` accessor method.  See\n[github issue #27](https://github.com/fgnass/domino/issues/27) for\nfurther discussion.  It does however implement direct indexed accessors\n(`element.attributes[i]`) and is live.\n\n\n\n## CSS Selector Support\n\nDomino provides support for `querySelector()`, `querySelectorAll()`, and `matches()` backed by the [Zest](https://github.com/chjj/zest) selector engine.\n\n## Optimization\n\nDomino represents the DOM tree structure in the same way Webkit and\nother browser-based implementations do: as a linked list of children\nwhich is converted to an array-based representation iff the\n`Node#childNodes` accessor is used.  You will get the best performance\nfrom tree modification code (inserting and removing children) if you\navoid the use of `Node#childNodes` and traverse the tree using\n`Node#firstChild`/`Node#nextSibling` (or\n`Node#lastChild`/`Node#previousSibling`) or `querySelector()`/etc.\n\n## Usage\n\nDomino supports the DOM level 4 API, and thus API documentation can be\nfound on standard reference sites.  For example, you could start from\nMDN's documentation for\n[Document](https://developer.mozilla.org/en-US/docs/Web/API/Document) and\n[Node](https://developer.mozilla.org/en-US/docs/Web/API/Node).\n\nThe only exception is the initial creation of a document:\n```javascript\nvar domino = require('domino');\nvar Element = domino.impl.Element; // etc\n\nvar window = domino.createWindow('<h1>Hello world</h1>', 'http://example.com');\nvar document = window.document;\n\n// alternatively: document = domino.createDocument(htmlString, true)\n\nvar h1 = document.querySelector('h1');\nconsole.log(h1.innerHTML);\nconsole.log(h1 instanceof Element);\n```\n\nThere is also an incremental parser available, if you need to interleave\nparsing with other processing:\n```javascript\nvar domino = require('domino');\n\nvar pauseAfter = function(ms) {\n  var start = Date.now();\n  return function() { return (Date.now() - start) >= ms; };\n};\n\nvar incrParser = domino.createIncrementalHTMLParser();\nincrParser.write('<p>hello<');\nincrParser.write('b>&am');\nincrParser.process(pauseAfter(1/*ms*/)); // can interleave processing\nincrParser.write('p;');\n// ...etc...\nincrParser.end(); // when done writing the document\n\nwhile (incrParser.process(pauseAfter(10/*ms*/))) {\n  // ...do other housekeeping...\n}\n\nconsole.log(incrParser.document().outerHTML);\n```\n\nIf you want a more standards-compliant way to create a `Document`, you can\nalso use [DOMImplementation](https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation):\n```javascript\nvar domino = require('domino');\nvar domimpl = domino.createDOMImplementation();\nvar doc = domimpl.createHTMLDocument();\n```\n\nBy default many domino methods will be stored in writable properties, to\nallow polyfills (as browsers do).  You can lock down the implementation\nif desired as follows:\n```javascript\nglobal.__domino_frozen__ = true; // Must precede any `require('domino')`\nvar domino = require('domino');\n```\n\n## Tests\n\nDomino includes test from the [W3C DOM Conformance Suites](http://www.w3.org/DOM/Test/)\nas well as tests from [HTML Working Group](http://www.w3.org/html/wg/wiki/Testing).\n\nThe tests can be run via `npm test` or directly though the [Mocha](http://mochajs.org/) command line:\n\n![Screenshot](http://fgnass.github.com/images/domino.png)\n\n## License and Credits\n\nThe majority of the code was originally written by [Andreas Gal](https://github.com/andreasgal/) and [David Flanagan](https://github.com/davidflanagan) as part of the [dom.js](https://github.com/andreasgal/dom.js) project. Please refer to the included LICENSE file for the original copyright notice and disclaimer.\n\n[Felix Gnass](https://github.com/fgnass/) extracted the code and turned\nit into a stand-alone npm package.\n\nThe code has been maintained since 2013 by [C. Scott Ananian](https://github.com/cscott/) on behalf of the Wikimedia Foundation, which uses it in its\n[Parsoid](https://www.mediawiki.org/wiki/Parsoid) project.  A large number\nof improvements have been made, mostly focusing on correctness,\nperformance, and (to a lesser extent) completeness of the implementation.\n\n[1]: https://travis-ci.org/fgnass/domino.svg\n[2]: https://travis-ci.org/fgnass/domino\n[3]: https://david-dm.org/fgnass/domino.svg\n[4]: https://david-dm.org/fgnass/domino\n[5]: https://david-dm.org/fgnass/domino/dev-status.svg\n[6]: https://david-dm.org/fgnass/domino#info=devDependencies\n","publish_time":1550176997341,"_cnpm_publish_time":1550176997341,"dist-tags":{"latest":"2.1.9"}}