{ "_args": [ [ { "raw": "jsdom@^11.5.1", "scope": null, "escapedName": "jsdom", "name": "jsdom", "rawSpec": "^11.5.1", "spec": ">=11.5.1 <12.0.0", "type": "range" }, "/home/jdaugherty/work/GT2/GT2-Android/node_modules/jest-environment-jsdom" ] ], "_from": "jsdom@>=11.5.1 <12.0.0", "_id": "jsdom@11.6.2", "_inCache": true, "_location": "/jsdom", "_nodeVersion": "8.9.4", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", "tmp": "tmp/jsdom-11.6.2.tgz_1517279571318_0.11436918587423861" }, "_npmUser": { "name": "domenic", "email": "d@domenic.me" }, "_npmVersion": "5.6.0", "_phantomChildren": { "async-limiter": "1.0.0", "safe-buffer": "5.1.1" }, "_requested": { "raw": "jsdom@^11.5.1", "scope": null, "escapedName": "jsdom", "name": "jsdom", "rawSpec": "^11.5.1", "spec": ">=11.5.1 <12.0.0", "type": "range" }, "_requiredBy": [ "/jest-environment-jsdom" ], "_resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", "_shasum": "25d1ef332d48adf77fc5221fe2619967923f16bb", "_shrinkwrap": null, "_spec": "jsdom@^11.5.1", "_where": "/home/jdaugherty/work/GT2/GT2-Android/node_modules/jest-environment-jsdom", "browser": { "canvas": false, "vm": "./lib/jsdom/vm-shim.js", "./lib/jsdom/living/websockets/WebSocket-impl.js": "./lib/jsdom/living/websockets/WebSocket-impl-browser.js" }, "bugs": { "url": "https://github.com/jsdom/jsdom/issues" }, "dependencies": { "abab": "^1.0.4", "acorn": "^5.3.0", "acorn-globals": "^4.1.0", "array-equal": "^1.0.0", "browser-process-hrtime": "^0.1.2", "content-type-parser": "^1.0.2", "cssom": ">= 0.3.2 < 0.4.0", "cssstyle": ">= 0.2.37 < 0.3.0", "domexception": "^1.0.0", "escodegen": "^1.9.0", "html-encoding-sniffer": "^1.0.2", "left-pad": "^1.2.0", "nwmatcher": "^1.4.3", "parse5": "4.0.0", "pn": "^1.1.0", "request": "^2.83.0", "request-promise-native": "^1.0.5", "sax": "^1.2.4", "symbol-tree": "^3.2.2", "tough-cookie": "^2.3.3", "w3c-hr-time": "^1.0.1", "webidl-conversions": "^4.0.2", "whatwg-encoding": "^1.0.3", "whatwg-url": "^6.4.0", "ws": "^4.0.0", "xml-name-validator": "^3.0.0" }, "description": "A JavaScript implementation of many web standards", "devDependencies": { "benchmark": "1.0.0", "browserify": "^14.5.0", "chai": "^4.1.2", "eslint": "^4.16.0", "eslint-find-rules": "^3.1.1", "eslint-plugin-html": "^4.0.1", "js-yaml": "^3.10.0", "karma": "^1.7.1", "karma-browserify": "^5.1.3", "karma-chrome-launcher": "^2.2.0", "karma-mocha": "^1.3.0", "karma-mocha-webworker": "^1.3.0", "karma-sauce-launcher": "^1.2.0", "minimatch": "^3.0.4", "mocha": "^3.5.2", "mocha-sugar-free": "^1.3.1", "optimist": "0.6.1", "portfinder": "^1.0.13", "q": "^1.5.1", "rimraf": "^2.6.2", "server-destroy": "^1.0.1", "st": "^1.2.2", "watchify": "^3.9.0", "wd": "^1.5.0", "webidl2js": "^9.0.0" }, "directories": {}, "dist": { "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", "shasum": "25d1ef332d48adf77fc5221fe2619967923f16bb", "tarball": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz" }, "gitHead": "1cd4831e36b40c8041237d5cf184f229f358ffc0", "homepage": "https://github.com/jsdom/jsdom#readme", "keywords": [ "dom", "html", "whatwg", "w3c" ], "license": "MIT", "main": "./lib/api.js", "maintainers": [ { "name": "Elijah Insua", "email": "tmpvar@gmail.com", "url": "http://tmpvar.com" }, { "name": "Domenic Denicola", "email": "d@domenic.me", "url": "https://domenic.me/" }, { "name": "Sebastian Mayr", "email": "sebmaster16@gmail.com", "url": "https://blog.smayr.name/" }, { "name": "Joris van der Wel", "email": "joris@jorisvanderwel.com" }, { "name": "Timothy Gu", "email": "timothygu99@gmail.com", "url": "https://timothygu.me/" }, { "name": "Zirro", "email": "code@zirro.se" } ], "name": "jsdom", "optionalDependencies": {}, "readme": "# jsdom\n\njsdom is a pure-JavaScript implementation of many web standards, notably the WHATWG [DOM](https://dom.spec.whatwg.org/) and [HTML](https://html.spec.whatwg.org/multipage/) Standards, for use with Node.js. In general, the goal of the project is to emulate enough of a subset of a web browser to be useful for testing and scraping real-world web applications.\n\nThe latest versions of jsdom require Node.js v6 or newer. (Versions of jsdom below v10 still work with Node.js v4, but are unsupported.)\n\nAs of v10, jsdom has a new API (documented below). The old API is still supported for now; [see its documentation](./lib/old-api.md) for details.\n\n## Basic usage\n\n```js\nconst jsdom = require(\"jsdom\");\nconst { JSDOM } = jsdom;\n```\n\nTo use jsdom, you will primarily use the `JSDOM` constructor, which is a named export of the jsdom main module. Pass the constructor a string. You will get back a `JSDOM` object, which has a number of useful properties, notably `window`:\n\n```js\nconst dom = new JSDOM(`
Hello world
`);\nconsole.log(dom.window.document.querySelector(\"p\").textContent); // \"Hello world\"\n```\n\n(Note that jsdom will parse the HTML you pass it just like a browser does, including implied ``, ``, and `` tags.)\n\nThe resulting object is an instance of the `JSDOM` class, which contains a number of useful properties and methods besides `window`. In general it can be used to act on the jsdom from the \"outside,\" doing things that are not possible with the normal DOM APIs. For simple cases, where you don't need any of this functionality, we recommend a coding pattern like\n\n```js\nconst { window } = new JSDOM(`...`);\n// or even\nconst { document } = (new JSDOM(`...`)).window;\n```\n\nFull documentation on everything you can do with the `JSDOM` class is below, in the section \"`JSDOM` Object API\".\n\n## Customizing jsdom\n\nThe `JSDOM` constructor accepts a second parameter which can be used to customize your jsdom in the following ways.\n\n### Simple options\n\n```js\nconst dom = new JSDOM(``, {\n url: \"https://example.org/\",\n referrer: \"https://example.com/\",\n contentType: \"text/html\",\n userAgent: \"Mellblomenator/9000\",\n includeNodeLocations: true\n});\n```\n\n- `url` sets the value returned by `window.location`, `document.URL`, and `document.documentURI`, and affects things like resolution of relative URLs within the document and the same-origin restrictions and referrer used while fetching subresources. It defaults to `\"about:blank\"`.\n- `referrer` just affects the value read from `document.referrer`. It defaults to no referrer (which reflects as the empty string).\n- `contentType` affects the value read from `document.contentType`, and how the document is parsed: as HTML or as XML. Values that are not `\"text/html\"` or an [XML mime type](https://html.spec.whatwg.org/multipage/infrastructure.html#xml-mime-type) will throw. It defaults to `\"text/html\"`.\n- `userAgent` affects the value read from `navigator.userAgent`, as well as the `User-Agent` header sent while fetching subresources. It defaults to\\`Mozilla/5.0 (${process.platform}) AppleWebKit/537.36 (KHTML, like Gecko) jsdom/${jsdomVersion}\\`.\n- `includeNodeLocations` preserves the location info produced by the HTML parser, allowing you to retrieve it with the `nodeLocation()` method (described below). It also ensures that line numbers reported in exception stack traces for code running inside `\n`);\n\n// The script will not be executed, by default:\ndom.window.document.body.children.length === 1;\n```\n\nTo enable executing scripts inside the page, you can use the `runScripts: \"dangerously\"` option:\n\n```js\nconst dom = new JSDOM(`\n \n`, { runScripts: \"dangerously\" });\n\n// The script will be executed and modify the DOM:\ndom.window.document.body.children.length === 2;\n```\n\nAgain we emphasize to only use this when feeding jsdom code you know is safe. If you use it on arbitrary user-supplied code, or code from the Internet, you are effectively running untrusted Node.js code, and your machine could be compromised.\n\nNote that event handler attributes, like `