mazda-specs-crepe/node_modules/jsdom/package.json
2013-02-19 18:02:59 +11:00

215 lines
14 KiB
JSON

{
"name": "jsdom",
"version": "0.3.4",
"description": "A JavaScript implementation of the W3C DOM",
"keywords": [
"dom",
"w3c",
"html"
],
"maintainers": [
{
"name": "Elijah Insua",
"email": "tmpvar@gmail.com",
"url": "http://tmpvar.com"
},
{
"name": "Domenic Denicola",
"email": "domenic@domenicdenicola.com",
"url": "http://domenicdenicola.com"
}
],
"contributors": [
{
"name": "Vincent Greene",
"email": "ulteriorlife@gmail.com"
},
{
"name": "Dav Glass",
"email": "davglass@gmail.com"
},
{
"name": "Felix Gnass",
"email": "fgnass@gmail.com"
},
{
"name": "Charlie Robbins",
"email": "charlie.robbins@gmail.com"
},
{
"name": "Aria Stewart",
"email": "aredridel@nbtsc.org"
},
{
"name": "Matthew",
"email": "N.A.",
"url": "http://github.com/matthewpflueger/"
},
{
"name": "Olivier El Mekki",
"email": "unknown",
"url": "http://blog.olivier-elmekki.com/"
},
{
"name": "Shimon Dookdin",
"email": "helpmepro1@gmail.com"
},
{
"name": "Daniel Cassidy",
"email": "mail@danielcassidy.me.uk",
"url": "http://www.danielcassidy.me.uk/"
},
{
"name": "Sam Ruby",
"url": "http://intertwingly.net/blog/"
},
{
"name": "hij1nx",
"url": "http://github.com/hij1nx"
},
{
"name": "Yonathan Randolph",
"url": "http://github.com/yonran"
},
{
"name": "Martin Davis",
"url": "http://github.com/waslogic"
},
{
"name": "Andreas Lind Petersen",
"email": "andreas@one.com"
},
{
"name": "d-ash",
"url": "http://github.com/d-ash"
},
{
"name": "Robin Zhong",
"email": "fbzhong@gmail.com"
},
{
"name": "Alexander Flatter",
"email": "flatter@gmail.com"
},
{
"name": "Heng Liu",
"email": "liucougar@gmail.com"
},
{
"name": "Brian McDaniel",
"url": "http://github.com/brianmcd"
},
{
"name": "John Hurliman",
"email": "jhurliman@jhurliman.org"
},
{
"name": "Jimmy Mabey"
},
{
"name": "Gregory Tomlinson"
},
{
"name": "Jason Davies",
"url": "http://www.jasondavies.com/"
},
{
"name": "Josh Marshall",
"url": "http://www.ponderingtheobvious.com/"
},
{
"name": "Jason Priestley",
"url": "https://github.com/jhp"
},
{
"name": "Derek Lindahl",
"url": "https://github.com/dlindahl"
},
{
"name": "Chris Roebuck",
"email": "chris@quillu.com",
"url": "http://www.quillu.com"
},
{
"name": "Avi Deitcher",
"url": "https://github.com/deitch"
},
{
"name": "Nao Iizuka",
"email": "iizuka@kyu-mu.net",
"url": "https://github.com/iizukanao"
},
{
"name": "Peter Perenyi",
"url": "https://github.com/sinegar"
},
{
"name": "Tiago Rodrigues",
"email": "tmcrodrigues@gmail.com",
"url": "http://trodrigues.net"
},
{
"name": "Samori Gorse",
"email": "samorigorse@gmail.com",
"url": "http://github.com/shinuza"
},
{
"name": "John Roberts",
"email": "jroberts@logitech.com"
},
{
"name": "Chad Walker",
"email": "chad@chad-cat-lore-eddie.com",
"url": "https://github.com/chad3814"
}
],
"bugs": {
"email": "tmpvar@gmail.com",
"url": "http://github.com/tmpvar/jsdom/issues"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/tmpvar/jsdom/blob/master/LICENSE.txt"
}
],
"repositories": [
{
"type": "git",
"url": "http://github.com/tmpvar/jsdom.git"
}
],
"implements": [
"http://www.w3.org/TR/REC-DOM-Level-1"
],
"dependencies": {
"htmlparser": "1.x",
"nwmatcher": ">=1.3.0",
"request": "2.x",
"cssom": "0.2.x",
"cssstyle": ">=0.2.3",
"contextify": "0.1.x"
},
"optionalDependencies": {
"contextify": "0.1.x"
},
"devDependencies": {
"nodeunit": ">=0.5.x",
"console.log": "*",
"html5": ">=0.3.8",
"optimist": "*"
},
"directories": {
"lib": "./lib/jsdom"
},
"scripts": {
"test": "node ./test/runner"
},
"main": "./lib/jsdom",
"readme": "# jsdom\n\nA JavaScript implementation of the W3C DOM.\n\n## Install\n\n```bash\n$ npm install jsdom\n```\n\n## Human contact\n\nsee: [mailing list](http://groups.google.com/group/jsdom)\n\n## Easymode\n\nBootstrapping a DOM is generally a difficult process involving many error prone steps. We didn't want jsdom to fall into the same trap and that is why a new method, `jsdom.env()`, has been added in jsdom 0.2.0 which should make everyone's lives easier.\n\nwith URL\n\n```js\n// Count all of the links from the nodejs build page\nvar jsdom = require(\"jsdom\");\n\njsdom.env(\n \"http://nodejs.org/dist/\",\n [\"http://code.jquery.com/jquery.js\"],\n function (errors, window) {\n console.log(\"there have been\", window.$(\"a\").length, \"nodejs releases!\");\n }\n);\n```\n\nor with raw HTML\n\n```js\n// Run some jQuery on a html fragment\nvar jsdom = require(\"jsdom\");\n\njsdom.env(\n '<p><a class=\"the-link\" href=\"https://github.com/tmpvar/jsdom\">jsdom\\'s Homepage</a></p>',\n [\"http://code.jquery.com/jquery.js\"],\n function(errors, window) {\n console.log(\"contents of a.the-link:\", window.$(\"a.the-link\").text());\n }\n);\n```\n\nor with a configuration object\n\n```js\n// Print all of the news items on hackernews\nvar jsdom = require(\"jsdom\");\n\njsdom.env({\n html: \"http://news.ycombinator.com/\",\n scripts: [\"http://code.jquery.com/jquery.js\"],\n done: function (errors, window) {\n var $ = window.$;\n console.log(\"HN Links\");\n $(\"td.title:not(:last) a\").each(function() {\n console.log(\" -\", $(this).text());\n });\n }\n});\n```\n\nor with raw JavaScript source\n\n```js\n// Print all of the news items on hackernews\nvar jsdom = require(\"jsdom\");\nvar fs = require(\"fs\");\nvar jquery = fs.readFileSync(\"./jquery.js\").toString();\n\njsdom.env({\n html: \"http://news.ycombinator.com/\",\n src: [jquery],\n done: function (errors, window) {\n var $ = window.$;\n console.log(\"HN Links\");\n $(\"td.title:not(:last) a\").each(function() {\n console.log(\" -\", $(this).text());\n });\n }\n});\n```\n\n### How it works\n`jsdom.env` is built for ease of use, which is rare in the world of the DOM! Since the web has some absolutely horrible JavaScript on it, as of jsdom 0.2.0 `jsdom.env` will not process external resources (scripts, images, etc). If you want to process the JavaScript use one of the methods below (`jsdom.jsdom` or `jsdom.jQueryify`)\n\n```js\njsdom.env(html, [scripts], [config], callback);\n```\n\n- `html` (**required**): may be a URL, HTML fragment, or file.\n- `scripts` (**optional**): may contain files or URLs.\n- `config` (**optional**): see below.\n- `callback` (**required**): takes two arguments:\n - `errors`: an array of errors\n - `window`: a brand new window\n\n_example:_\n\n```js\njsdom.env(html, function (errors, window) {\n // free memory associated with the window\n window.close();\n});\n```\n\nIf you would like to specify a configuration object only:\n\n```js\njsdom.env(config);\n```\n\n- `config.html`: see `html` above.\n- `config.scripts`: see `scripts` above.\n- `config.src`: an array of JavaScript strings that will be evaluated against the resulting document. Similar to `scripts`, but it accepts JavaScript instead of paths/URLs.\n- `config.done`: see `callback` above.\n- `config.document`:\n - `referer`: the new document will have this referer\n - `cookie`: manually set a cookie value, e.g. `'key=value; expires=Wed, Sep 21 2011 12:00:00 GMT; path=/'`\n- `config.features` : see `Flexibility` section below. **Note**: the default feature set for jsdom.env does _not_ include fetching remote JavaScript and executing it. This is something that you will need to **carefully** enable yourself.\n\n## For the hardcore\n\nIf you want to spawn a document/window and specify all sorts of options this is the section for you. This section covers the `jsdom.jsdom` method:\n\n```js\nvar jsdom = require(\"jsdom\").jsdom;\nvar doc = jsdom(markup, level, options);\nvar window = doc.createWindow();\n```\n\n- `markup` is an HTML/XML document to be parsed. You can also pass `null` or an undefined value to get a basic document with empty `<head>` and `<body>` tags. Document fragments are also supported (including `\"\"`), and will behave as sanely as possible (e.g. the resulting document will lack the `head`, `body` and `documentElement` properties if the corresponding elements aren't included).\n\n- `level` is `null` (which means level3) by default, but you can pass another level if you'd like.\n\n ```js\n var jsdom = require(\"jsdom\");\n var doc = jsdom.jsdom(\"<html><body></body></html>\", jsdom.level(1, \"core\"));\n ```\n\n- `options` see the **Flexibility** section below.\n\n### Flexibility\n\nOne of the goals of jsdom is to be as minimal and light as possible. This section details how someone can change the behavior of `Document`s on the fly. These features are baked into the `DOMImplementation` that every `Document` has, and may be tweaked in two ways:\n\n1. When you create a new `Document` using the jsdom builder (`require(\"jsdom\").jsdom()`)\n\n ```js\n var jsdom = require(\"jsdom\").jsdom;\n var doc = jsdom(\"<html><body></body></html>\", null, {\n features: {\n FetchExternalResources : [\"img\"]\n }\n });\n ```\n\n Do note, that this will only affect the document that is currently being created. All other documents will use the defaults specified below (see: Default Features).\n\n2. Before creating any documents, you can modify the defaults for all future documents:\n\n ```js\n require(\"jsdom\").defaultDocumentFeatures = {\n FetchExternalResources: [\"script\"],\n ProcessExternalResources: false\n };\n ```\n\n#### Default Features\n\nDefault features are extremely important for jsdom as they lower the configuration requirement and present developers a set of consistent default behaviors. The following sections detail the available features, their defaults, and the values that jsdom uses.\n\n\n`FetchExternalResources`\n\n- _Default_: `[\"script\"]`\n- _Allowed_: `[\"script\", \"img\", \"css\", \"frame\", \"iframe\", \"link\"]` or `false`\n\nEnables/disables fetching files over the file system/HTTP.\n\n`ProcessExternalResources`\n\n- _Default_: `[\"script\"]`\n- _Allowed_: `[\"script\"]` or `false`\n\nDisabling this will disable script execution (currently only JavaScript).\n\n`SkipExternalResources`\n\n- _Default_: `false`\n- _Allowed_: `/url to be skipped/` or `false`\n- _Example_: `/http:\\/\\/example.org/js/bad\\.js/`\n\nDo not download and process resources with url matching a regular expression.\n\n## Canvas\n\njsdom includes support for using the [canvas](https://npmjs.org/package/canvas) package to extend any `<canvas>` elements with the canvas API. To make this work, you need to include canvas as a dependency in your project, as a peer of jsdom. If jsdom can find the canvas package, it will use it, but if it's not present, then `<canvas>` elements will behave like `<div>`s.\n\n# More Examples\n\n## Creating a document-less window\n\n```js\nvar jsdom = require(\"jsdom\");\nvar window = jsdom.createWindow();\n\nconsole.log(window.document); // output: undefined\n```\n\n## Creating a document\n\n```js\nvar jsdom = require(\"jsdom\");\nvar doc = new (jsdom.level(1, \"core\").Document)();\n\nconsole.log(doc.nodeName); // outputs: #document\n```\n\n## Creating a browser-like BOM/DOM/Window\n\n```js\nvar jsdom = require(\"jsdom\").jsdom;\nvar document = jsdom(\"<html><head></head><body>hello world</body></html>\");\nvar window = document.createWindow();\n\nconsole.log(window.document.innerHTML);\n// output: \"<html><head></head><body>hello world</body></html>\"\n\nconsole.log(window.innerWidth);\n// output: 1024\n\nconsole.log(typeof window.document.getElementsByClassName);\n// outputs: function\n```\n\n## jQueryify\n\n```js\nvar jsdom = require(\"jsdom\");\nvar window = jsdom.jsdom().createWindow();\n\njsdom.jQueryify(window, \"http://code.jquery.com/jquery.js\", function () {\n window.$(\"body\").append('<div class=\"testing\">Hello World, It works</div>');\n\n console.log(window.$(\".testing\").text());\n});\n```\n\n## Passing objects to scripts inside the page\n\n```js\nvar jsdom = require(\"jsdom\").jsdom;\nvar window = jsdom().createWindow();\n\nwindow.__myObject = { foo: \"bar\" };\n\nvar scriptEl = window.document.createElement(\"script\");\nscriptEl.src = \"anotherScript.js\";\nwindow.document.body.appendChild(scriptEl);\n\n// anotherScript.js will have the ability to read `window.__myObject`, even\n// though it originated in Node!\n```\n\n# Test Compliance:\n\n```\n level1/core 532/532 100%\n level1/html 238/238 100%\n level1/svg 527/527 100%\n level2/core 283/283 100%\n level2/html 697/697 100%\n level2/style 10/10 100%\n level2/extra 4/4 100%\n level2/events 24/24 100%\n level3/xpath 93/93 100%\n window/index 5/5 100%\n window/script 10/10 100%\n window/frame 14/14 100%\n sizzle/index 9/14 64%\n jsdom/index 86/86 100%\n jsonp/jsonp 1/1 100%\n browser/contextifyReplacement 4/4 100%\n browser/index 22/22 100%\n------------------------------------------------------\nTOTALS: 5/2564 failed; 99% success\n```\n\n## Running the tests\n\nFirst you'll want to `npm install`. To run all the tests, use `npm test`, which just calls `node test/runner`.\n\nUsing `test/runner` directly, you can slice and dice which tests your want to run from different levels. Usage is as follows:\n\n```\ntest/runner --help\nRun the jsdom test suite\n\nOptions:\n-s, --suites suites that you want to run. ie: -s level1/core,1/html,html [string]\n-f, --fail-fast stop on the first failed test\n-h, --help show the help\n-t, --tests choose the test cases to run. ie: -t jquery\n```\n",
"_id": "jsdom@0.3.4",
"dist": {
"shasum": "346d31d2efbfaa29843aeeabe28fb868a51da566"
},
"_from": "jsdom"
}