{"id":13766714,"url":"https://github.com/electron/get","last_synced_at":"2025-04-29T18:48:03.152Z","repository":{"id":31818701,"uuid":"35385455","full_name":"electron/get","owner":"electron","description":"Download Electron release artifacts","archived":false,"fork":false,"pushed_at":"2025-04-11T15:44:47.000Z","size":45291,"stargazers_count":357,"open_issues_count":8,"forks_count":108,"subscribers_count":22,"default_branch":"main","last_synced_at":"2025-04-18T12:16:26.314Z","etag":null,"topics":["electron"],"latest_commit_sha":null,"homepage":"https://npm.im/@electron/get","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/electron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-05-10T19:47:51.000Z","updated_at":"2025-04-11T15:44:50.000Z","dependencies_parsed_at":"2023-02-14T13:16:10.152Z","dependency_job_id":"92a80c17-127e-4a05-a4d6-552e8e026486","html_url":"https://github.com/electron/get","commit_stats":{"total_commits":332,"total_committers":35,"mean_commits":9.485714285714286,"dds":0.8373493975903614,"last_synced_commit":"8e394cf6dcd31ef9a51f3ec58f2b4d827cf1db73"},"previous_names":["electron-userland/electron-download"],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron%2Fget","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron%2Fget/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron%2Fget/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/electron%2Fget/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/electron","download_url":"https://codeload.github.com/electron/get/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249586314,"owners_count":21295340,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["electron"],"created_at":"2024-08-03T16:00:59.805Z","updated_at":"2025-04-29T18:48:03.129Z","avatar_url":"https://github.com/electron.png","language":"TypeScript","readme":"# @electron/get\n\n\u003e Download Electron release artifacts\n\n[![Test](https://github.com/electron/get/actions/workflows/test.yml/badge.svg)](https://github.com/electron/get/actions/workflows/test.yml)\n[![NPM package](https://img.shields.io/npm/v/@electron/get)](https://npm.im/@electron/get)\n\n## Usage\n\nFor full API details, see the [API documentation](https://packages.electronjs.org/get/v4.0.0/index.html).\n\n### Simple: Downloading an Electron Binary ZIP\n\n```typescript\nimport { download } from '@electron/get';\n\n// NB: Use this syntax within an async function, Node does not have support for\n//     top-level await as of Node 12.\nconst zipFilePath = await download('4.0.4');\n```\n\n### Advanced: Downloading a macOS Electron Symbol File\n\n```typescript\nimport { downloadArtifact } from '@electron/get';\n\n// NB: Use this syntax within an async function, Node does not have support for\n//     top-level await as of Node 12.\nconst zipFilePath = await downloadArtifact({\n  version: '4.0.4',\n  platform: 'darwin',\n  artifactName: 'electron',\n  artifactSuffix: 'symbols',\n  arch: 'x64',\n});\n```\n\n### Specifying a mirror\n\nTo specify another location to download Electron assets from, the following options are\navailable:\n\n* `mirrorOptions` Object\n  * `mirror` String (optional) - The base URL of the mirror to download from.\n  * `nightlyMirror` String (optional) - The Electron nightly-specific mirror URL.\n  * `customDir` String (optional) - The name of the directory to download from, often scoped by version number.\n  * `customFilename` String (optional) - The name of the asset to download.\n  * `resolveAssetURL` Function (optional) - A function allowing customization of the url used to download the asset.\n\nAnatomy of a download URL, in terms of `mirrorOptions`:\n\n```\nhttps://github.com/electron/electron/releases/download/v4.0.4/electron-v4.0.4-linux-x64.zip\n|                                                     |       |                           |\n-------------------------------------------------------       -----------------------------\n                        |                                                   |\n              mirror / nightlyMirror                  |    |         customFilename\n                                                       ------\n                                                         ||\n                                                      customDir\n```\n\nExample:\n\n```typescript\nimport { download } from '@electron/get';\n\nconst zipFilePath = await download('4.0.4', {\n  mirrorOptions: {\n    mirror: 'https://mirror.example.com/electron/',\n    customDir: 'custom',\n    customFilename: 'unofficial-electron-linux.zip'\n  }\n});\n// Will download from https://mirror.example.com/electron/custom/unofficial-electron-linux.zip\n\nconst nightlyZipFilePath = await download('8.0.0-nightly.20190901', {\n  mirrorOptions: {\n    nightlyMirror: 'https://nightly.example.com/',\n    customDir: 'nightlies',\n    customFilename: 'nightly-linux.zip'\n  }\n});\n// Will download from https://nightly.example.com/nightlies/nightly-linux.zip\n```\n\n`customDir` can have the placeholder `{{ version }}`, which will be replaced by the version\nspecified (without the leading `v`). For example:\n\n```javascript\nconst zipFilePath = await download('4.0.4', {\n  mirrorOptions: {\n    mirror: 'https://mirror.example.com/electron/',\n    customDir: 'version-{{ version }}',\n    platform: 'linux',\n    arch: 'x64'\n  }\n});\n// Will download from https://mirror.example.com/electron/version-4.0.4/electron-v4.0.4-linux-x64.zip\n```\n\n#### Using environment variables for mirror options\nMirror options can also be specified via the following environment variables:\n* `ELECTRON_CUSTOM_DIR` - Specifies the custom directory to download from.\n* `ELECTRON_CUSTOM_FILENAME` - Specifies the custom file name to download.\n* `ELECTRON_MIRROR` - Specifies the URL of the server to download from if the version is not a nightly version.\n* `ELECTRON_NIGHTLY_MIRROR` - Specifies the URL of the server to download from if the version is a nightly version.\n\n### Overriding the version downloaded\n\nThe version downloaded can be overriden by setting the `ELECTRON_CUSTOM_VERSION` environment variable.\nSetting this environment variable will override the version passed in to `download` or `downloadArtifact`.\n\n## How It Works\n\nThis module downloads Electron to a known place on your system and caches it\nso that future requests for that asset can be returned instantly.  The cache\nlocations are:\n\n* Linux: `$XDG_CACHE_HOME` or `~/.cache/electron/`\n* MacOS: `~/Library/Caches/electron/`\n* Windows: `%LOCALAPPDATA%/electron/Cache` or `~/AppData/Local/electron/Cache/`\n\nBy default, the module uses [`got`](https://github.com/sindresorhus/got) as the\ndownloader. As a result, you can use the same [options](https://github.com/sindresorhus/got#options)\nvia `downloadOptions`.\n\n### Progress Bar\n\nBy default, a progress bar is shown when downloading an artifact for more than 30 seconds. To\ndisable, set the `ELECTRON_GET_NO_PROGRESS` environment variable to any non-empty value, or set\n`quiet` to `true` in `downloadOptions`. If you need to monitor progress yourself via the API, set\n`getProgressCallback` in `downloadOptions`, which has the same function signature as `got`'s\n[`downloadProgress` event callback](https://github.com/sindresorhus/got#ondownloadprogress-progress).\n\n### Proxies\n\nDownstream packages should utilize the `initializeProxy` function to add HTTP(S) proxy support. If\nthe environment variable `ELECTRON_GET_USE_PROXY` is set, it is called automatically.\n\n### Debug\n\n[`debug`](https://www.npmjs.com/package/debug) is used to display logs and messages.\nSet the `DEBUG=@electron/get*` environment variable to log additional\ndebug information from this module.\n","funding_links":[],"categories":["Tools","TypeScript"],"sub_categories":["For Electron"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectron%2Fget","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felectron%2Fget","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felectron%2Fget/lists"}