mirror of
https://github.com/S2-/minifyfromhtml.git
synced 2025-08-03 04:10:04 +02:00
update packages to latest version
This commit is contained in:
14
node_modules/jsdom/README.md
generated
vendored
14
node_modules/jsdom/README.md
generated
vendored
@@ -5,7 +5,7 @@
|
||||
|
||||
jsdom 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.
|
||||
|
||||
The latest versions of jsdom require Node.js v10 or newer. (Versions of jsdom below v16 still work with previous Node.js versions, but are unsupported.)
|
||||
The latest versions of jsdom require Node.js v14 or newer. (Versions of jsdom below v20 still work with previous Node.js versions, but are unsupported.)
|
||||
|
||||
## Basic usage
|
||||
|
||||
@@ -55,7 +55,7 @@ const dom = new JSDOM(``, {
|
||||
- `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 `<script>` elements are correct. It defaults to `false` to give the best performance, and cannot be used with an XML content type since our XML parser does not support location info.
|
||||
- `storageQuota` is the maximum size in code units for the separate storage areas used by `localStorage` and `sessionStorage`. Attempts to store data larger than this limit will cause a `DOMException` to be thrown. By default, it is set to 5,000,000 code units per origin, as inspired by the HTML specification.
|
||||
|
||||
Note that both `url` and `referrer` are canonicalized before they're used, so e.g. if you pass in `"https:example.com"`, jsdom will interpret that as if you had given `"https://example.com/"`. If you pass an unparseable URL, the call will throw. (URLs are parsed and serialized according to the [URL Standard](http://url.spec.whatwg.org/).)
|
||||
Note that both `url` and `referrer` are canonicalized before they're used, so e.g. if you pass in `"https:example.com"`, jsdom will interpret that as if you had given `"https://example.com/"`. If you pass an unparseable URL, the call will throw. (URLs are parsed and serialized according to the [URL Standard](https://url.spec.whatwg.org/).)
|
||||
|
||||
### Executing scripts
|
||||
|
||||
@@ -452,15 +452,15 @@ If you want to be sure to shut down a jsdom window, use `window.close()`, which
|
||||
|
||||
jsdom has some support for being run inside a web browser, using [browserify](https://browserify.org/). That is, inside a web browser, you can use a browserified jsdom to create an entirely self-contained set of plain JavaScript objects which look and act much like the browser's existing DOM objects, while being entirely independent of them. "Virtual DOM", indeed!
|
||||
|
||||
jsdom's primary target is still Node.js, and so we use language features that are only present in recent Node.js versions (namely, Node.js v8+). Thus, older browsers will likely not work. (Even transpilation will not help: we use `Proxy`s extensively throughout the jsdom codebase.)
|
||||
jsdom's primary target is still Node.js, and so we use language features that are only present in recent Node.js versions. Thus, older browsers will likely not work. (Even transpilation will not help: we use `Proxy`s extensively throughout the jsdom codebase.)
|
||||
|
||||
Notably, jsdom works well inside a web worker. The original contributor, [@lawnsea](https://github.com/lawnsea/), who made this possible, has [published a paper](https://pdfs.semanticscholar.org/47f0/6bb6607a975500a30e9e52d7c9fbc0034e27.pdf) about his project which uses this capability.
|
||||
|
||||
Not everything works perfectly when running jsdom inside a web browser. Sometimes that is because of fundamental limitations (such as not having filesystem access), but sometimes it is simply because we haven't spent enough time making the appropriate small tweaks. Bug reports are certainly welcome.
|
||||
|
||||
### Debugging the DOM using Chrome Devtools
|
||||
### Debugging the DOM using Chrome DevTools
|
||||
|
||||
As of Node.js v6 you can debug programs using Chrome Devtools. See the [official documentation](https://nodejs.org/en/docs/inspector/) for how to get started.
|
||||
In Node.js you can debug programs using Chrome DevTools. See the [official documentation](https://nodejs.org/en/docs/inspector/) for how to get started.
|
||||
|
||||
By default jsdom elements are formatted as plain old JS objects in the console. To make it easier to debug, you can use [jsdom-devtools-formatter](https://github.com/viddo/jsdom-devtools-formatter), which lets you inspect them like real DOM elements.
|
||||
|
||||
@@ -517,6 +517,6 @@ jsdom is a community-driven project maintained by a team of [volunteers](https:/
|
||||
|
||||
If you need help with jsdom, please feel free to use any of the following venues:
|
||||
|
||||
- The [mailing list](http://groups.google.com/group/jsdom) (best for "how do I" questions)
|
||||
- The [mailing list](https://groups.google.com/group/jsdom) (best for "how do I" questions)
|
||||
- The [issue tracker](https://github.com/jsdom/jsdom/issues) (best for bug reports)
|
||||
- The IRC channel: [#jsdom on freenode](irc://irc.freenode.net/jsdom)
|
||||
- The Matrix room: [#jsdom:matrix.org](https://matrix.to/#/#jsdom:matrix.org)
|
||||
|
Reference in New Issue
Block a user