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.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 [0672f2e](https://github.com/whatwg/url/commit/0672f2e2ef43aca18b59d90abb6dac21712399bb).
  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](https://url.spec.whatwg.org/#percent-decode): `percentDecode(buffer)`
  22. The `stateOverride` parameter is one of the following strings:
  23. - [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state)
  24. - [`"scheme"`](https://url.spec.whatwg.org/#scheme-state)
  25. - [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state)
  26. - [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state)
  27. - [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state)
  28. - [`"relative"`](https://url.spec.whatwg.org/#relative-state)
  29. - [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state)
  30. - [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state)
  31. - [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state)
  32. - [`"authority"`](https://url.spec.whatwg.org/#authority-state)
  33. - [`"host"`](https://url.spec.whatwg.org/#host-state)
  34. - [`"hostname"`](https://url.spec.whatwg.org/#hostname-state)
  35. - [`"port"`](https://url.spec.whatwg.org/#port-state)
  36. - [`"file"`](https://url.spec.whatwg.org/#file-state)
  37. - [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state)
  38. - [`"file host"`](https://url.spec.whatwg.org/#file-host-state)
  39. - [`"path start"`](https://url.spec.whatwg.org/#path-start-state)
  40. - [`"path"`](https://url.spec.whatwg.org/#path-state)
  41. - [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state)
  42. - [`"query"`](https://url.spec.whatwg.org/#query-state)
  43. - [`"fragment"`](https://url.spec.whatwg.org/#fragment-state)
  44. The URL record type has the following API:
  45. - [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme)
  46. - [`username`](https://url.spec.whatwg.org/#concept-url-username)
  47. - [`password`](https://url.spec.whatwg.org/#concept-url-password)
  48. - [`host`](https://url.spec.whatwg.org/#concept-url-host)
  49. - [`port`](https://url.spec.whatwg.org/#concept-url-port)
  50. - [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array)
  51. - [`query`](https://url.spec.whatwg.org/#concept-url-query)
  52. - [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment)
  53. - [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean)
  54. 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.
  55. 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`.
  56. ### `whatwg-url/webidl2js-wrapper` module
  57. 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).
  58. ## Development instructions
  59. First, install [Node.js](https://nodejs.org/). Then, fetch the dependencies of whatwg-url, by running from this directory:
  60. npm install
  61. To run tests:
  62. npm test
  63. To generate a coverage report:
  64. npm run coverage
  65. To build and run the live viewer:
  66. npm run prepare
  67. npm run build-live-viewer
  68. Serve the contents of the `live-viewer` directory using any web server.
  69. ## Supporting whatwg-url
  70. 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:
  71. - [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.
  72. - Contributing directly to the project.