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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. # @electron/get
  2. > Download Electron release artifacts
  3. [![CircleCI](https://circleci.com/gh/electron/get.svg?style=svg)](https://circleci.com/gh/electron/get)
  4. ## Usage
  5. ### Simple: Downloading an Electron Binary ZIP
  6. ```typescript
  7. import { download } from '@electron/get';
  8. // NB: Use this syntax within an async function, Node does not have support for
  9. // top-level await as of Node 12.
  10. const zipFilePath = await download('4.0.4');
  11. ```
  12. ### Advanced: Downloading a macOS Electron Symbol File
  13. ```typescript
  14. import { downloadArtifact } from '@electron/get';
  15. // NB: Use this syntax within an async function, Node does not have support for
  16. // top-level await as of Node 12.
  17. const zipFilePath = await downloadArtifact({
  18. version: '4.0.4',
  19. platform: 'darwin',
  20. artifactName: 'electron',
  21. artifactSuffix: 'symbols',
  22. arch: 'x64',
  23. });
  24. ```
  25. ### Specifying a mirror
  26. To specify another location to download Electron assets from, the following options are
  27. available:
  28. * `mirrorOptions` Object
  29. * `mirror` String (optional) - The base URL of the mirror to download from.
  30. * `nightlyMirror` String (optional) - The Electron nightly-specific mirror URL.
  31. * `customDir` String (optional) - The name of the directory to download from, often scoped by version number.
  32. * `customFilename` String (optional) - The name of the asset to download.
  33. * `resolveAssetURL` Function (optional) - A function allowing customization of the url used to download the asset.
  34. Anatomy of a download URL, in terms of `mirrorOptions`:
  35. ```
  36. https://github.com/electron/electron/releases/download/v4.0.4/electron-v4.0.4-linux-x64.zip
  37. | | | |
  38. ------------------------------------------------------- -----------------------------
  39. | |
  40. mirror / nightlyMirror | | customFilename
  41. ------
  42. ||
  43. customDir
  44. ```
  45. Example:
  46. ```typescript
  47. import { download } from '@electron/get';
  48. const zipFilePath = await download('4.0.4', {
  49. mirrorOptions: {
  50. mirror: 'https://mirror.example.com/electron/',
  51. customDir: 'custom',
  52. customFilename: 'unofficial-electron-linux.zip'
  53. }
  54. });
  55. // Will download from https://mirror.example.com/electron/custom/unofficial-electron-linux.zip
  56. const nightlyZipFilePath = await download('8.0.0-nightly.20190901', {
  57. mirrorOptions: {
  58. nightlyMirror: 'https://nightly.example.com/',
  59. customDir: 'nightlies',
  60. customFilename: 'nightly-linux.zip'
  61. }
  62. });
  63. // Will download from https://nightly.example.com/nightlies/nightly-linux.zip
  64. ```
  65. `customDir` can have the placeholder `{{ version }}`, which will be replaced by the version
  66. specified (without the leading `v`). For example:
  67. ```javascript
  68. const zipFilePath = await download('4.0.4', {
  69. mirrorOptions: {
  70. mirror: 'https://mirror.example.com/electron/',
  71. customDir: 'version-{{ version }}',
  72. platform: 'linux',
  73. arch: 'x64'
  74. }
  75. });
  76. // Will download from https://mirror.example.com/electron/version-4.0.4/electron-v4.0.4-linux-x64.zip
  77. ```
  78. #### Using environment variables for mirror options
  79. Mirror options can also be specified via the following environment variables:
  80. * `ELECTRON_CUSTOM_DIR` - Specifies the custom directory to download from.
  81. * `ELECTRON_CUSTOM_FILENAME` - Specifies the custom file name to download.
  82. * `ELECTRON_MIRROR` - Specifies the URL of the server to download from if the version is not a nightly version.
  83. * `ELECTRON_NIGHTLY_MIRROR` - Specifies the URL of the server to download from if the version is a nightly version.
  84. ### Overriding the version downloaded
  85. The version downloaded can be overriden by setting the `ELECTRON_CUSTOM_VERSION` environment variable.
  86. Setting this environment variable will override the version passed in to `download` or `downloadArtifact`.
  87. ## How It Works
  88. This module downloads Electron to a known place on your system and caches it
  89. so that future requests for that asset can be returned instantly. The cache
  90. locations are:
  91. * Linux: `$XDG_CACHE_HOME` or `~/.cache/electron/`
  92. * MacOS: `~/Library/Caches/electron/`
  93. * Windows: `%LOCALAPPDATA%/electron/Cache` or `~/AppData/Local/electron/Cache/`
  94. By default, the module uses [`got`](https://github.com/sindresorhus/got) as the
  95. downloader. As a result, you can use the same [options](https://github.com/sindresorhus/got#options)
  96. via `downloadOptions`.
  97. ### Progress Bar
  98. By default, a progress bar is shown when downloading an artifact for more than 30 seconds. To
  99. disable, set the `ELECTRON_GET_NO_PROGRESS` environment variable to any non-empty value, or set
  100. `quiet` to `true` in `downloadOptions`. If you need to monitor progress yourself via the API, set
  101. `getProgressCallback` in `downloadOptions`, which has the same function signature as `got`'s
  102. [`downloadProgress` event callback](https://github.com/sindresorhus/got#ondownloadprogress-progress).
  103. ### Proxies
  104. Downstream packages should utilize the `initializeProxy` function to add HTTP(S) proxy support. If
  105. the environment variable `ELECTRON_GET_USE_PROXY` is set, it is called automatically. A different
  106. proxy module is used, depending on the version of Node in use, and as such, there are slightly
  107. different ways to set the proxy environment variables. For Node 10 and above,
  108. [`global-agent`](https://github.com/gajus/global-agent#environment-variables) is used. Otherwise,
  109. [`global-tunnel-ng`](https://github.com/np-maintain/global-tunnel#auto-config) is used. Refer to the
  110. appropriate linked module to determine how to configure proxy support.