Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 6.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # whatwg-url
  2. whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/jsdom/jsdom).
  3. ## Specification conformance
  4. whatwg-url is currently up to date with the URL spec up to commit [ab0e820](https://github.com/whatwg/url/commit/ab0e820b0b559610b30c731b7f2c1a8094181680).
  5. For `file:` URLs, whose [origin is left unspecified](https://url.spec.whatwg.org/#concept-url-origin), whatwg-url chooses to use a new opaque origin (which serializes to `"null"`).
  6. whatwg-url does not yet implement any encoding handling beyond UTF-8. That is, the _encoding override_ parameter does not exist in our API.
  7. ## API
  8. ### The `URL` and `URLSearchParams` classes
  9. The main API is provided by the [`URL`](https://url.spec.whatwg.org/#url-class) and [`URLSearchParams`](https://url.spec.whatwg.org/#interface-urlsearchparams) exports, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use these.
  10. ### Low-level URL Standard API
  11. The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They mostly operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type.
  12. - [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL })`
  13. - [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, url, stateOverride })`
  14. - [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)`
  15. - [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)`
  16. - [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)`
  17. - [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin): `serializeURLOrigin(urlRecord)`
  18. - [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)`
  19. - [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)`
  20. - [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)`
  21. - [Percent decode bytes](https://url.spec.whatwg.org/#percent-decode): `percentDecodeBytes(uint8Array)`
  22. - [Percent decode a string](https://url.spec.whatwg.org/#percent-decode-string): `percentDecodeString(string)`
  23. The `stateOverride` parameter is one of the following strings:
  24. - [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state)
  25. - [`"scheme"`](https://url.spec.whatwg.org/#scheme-state)
  26. - [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state)
  27. - [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state)
  28. - [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state)
  29. - [`"relative"`](https://url.spec.whatwg.org/#relative-state)
  30. - [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state)
  31. - [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state)
  32. - [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state)
  33. - [`"authority"`](https://url.spec.whatwg.org/#authority-state)
  34. - [`"host"`](https://url.spec.whatwg.org/#host-state)
  35. - [`"hostname"`](https://url.spec.whatwg.org/#hostname-state)
  36. - [`"port"`](https://url.spec.whatwg.org/#port-state)
  37. - [`"file"`](https://url.spec.whatwg.org/#file-state)
  38. - [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state)
  39. - [`"file host"`](https://url.spec.whatwg.org/#file-host-state)
  40. - [`"path start"`](https://url.spec.whatwg.org/#path-start-state)
  41. - [`"path"`](https://url.spec.whatwg.org/#path-state)
  42. - [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state)
  43. - [`"query"`](https://url.spec.whatwg.org/#query-state)
  44. - [`"fragment"`](https://url.spec.whatwg.org/#fragment-state)
  45. The URL record type has the following API:
  46. - [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme)
  47. - [`username`](https://url.spec.whatwg.org/#concept-url-username)
  48. - [`password`](https://url.spec.whatwg.org/#concept-url-password)
  49. - [`host`](https://url.spec.whatwg.org/#concept-url-host)
  50. - [`port`](https://url.spec.whatwg.org/#concept-url-port)
  51. - [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array)
  52. - [`query`](https://url.spec.whatwg.org/#concept-url-query)
  53. - [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment)
  54. - [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean)
  55. These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state.
  56. The return value of "failure" in the spec is represented by `null`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ `null`.
  57. ### `whatwg-url/webidl2js-wrapper` module
  58. This module exports the `URL` and `URLSearchParams` [interface wrappers API](https://github.com/jsdom/webidl2js#for-interfaces) generated by [webidl2js](https://github.com/jsdom/webidl2js).
  59. ## Development instructions
  60. First, install [Node.js](https://nodejs.org/). Then, fetch the dependencies of whatwg-url, by running from this directory:
  61. npm install
  62. To run tests:
  63. npm test
  64. To generate a coverage report:
  65. npm run coverage
  66. To build and run the live viewer:
  67. npm run prepare
  68. npm run build-live-viewer
  69. Serve the contents of the `live-viewer` directory using any web server.
  70. ## Supporting whatwg-url
  71. The jsdom project (including whatwg-url) is a community-driven project maintained by a team of [volunteers](https://github.com/orgs/jsdom/people). You could support us by:
  72. - [Getting professional support for whatwg-url](https://tidelift.com/subscription/pkg/npm-whatwg-url?utm_source=npm-whatwg-url&utm_medium=referral&utm_campaign=readme) as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security.
  73. - Contributing directly to the project.