{"_id":"@electron/get@5.1.0","bugs":{"url":"https://github.com/electron/get/issues"},"dist":{"shasum":"f96ca2a0e89b27490ff8f7b5a392bd4df6942998","tarball":"http://registry-npm.ywwl.com/@electron/get/download/@electron/get-5.1.0.tgz","fileCount":30,"integrity":"sha512-3kSBtG8ObcTVfXanm5vVJ6UnBLEVmVsRk1M+vGqCuMBV+XLCbJYuWQful+yIy0GQDsSlK0kHEriEHn7SPk4EnA==","signatures":[{"sig":"MEUCIQC1Uolwbr6Dtysg0uypfAgcomcnrBxSG970DAx9pwQBuwIgcB3PbetO75daA4FBRqen1C2jThZWgL9U7lDs0z4VYHE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCvDcz23I6JfglR9+T8eaAEBH7psVLxfSflJfeJgbuXawIhAPK5ay2Zn78hLXPiOBPOf1GSrjsTMUGm2FECddrV/Cyo"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@electron%2fget@5.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":71665,"size":20211,"noattachment":false,"key":"/@electron/get/-/@electron/get-5.1.0.tgz"},"name":"@electron/get","type":"module","author":{"name":"Samuel Attard"},"engines":{"node":">=22.12.0"},"exports":"./dist/index.js","gitHead":"da84467eacf58f36a8d43de64a09dd2cfe491d3f","license":"MIT","scripts":{"lint":"oxfmt --check . && oxlint","test":"vitest run --coverage","build":"tsc","prepare":"husky","lint:fix":"oxfmt --write . && oxlint --fix","build:docs":"typedoc","prepublishOnly":"npm run build","test:nonetwork":"npm run lint && vitest run --coverage --testPathIgnorePatterns network.spec"},"version":"5.1.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc90f928-3957-42c6-a68d-3af08afad019"}},"homepage":"https://github.com/electron/get#readme","keywords":["electron","download","prebuild","get","artifact","release"],"repository":{"url":"git+https://github.com/electron/get.git","type":"git"},"_npmVersion":"11.6.2","description":"Utility for downloading artifacts from different versions of Electron","directories":{},"lint-staged":{"*.{json}":["oxfmt --write"],"*.{js,ts}":["oxfmt --write","oxlint --fix"]},"maintainers":[{"name":"electron-cfa","email":"info+cfa-npm@electronjs.org"}],"resolutions":{"fsevents":"npm:@electron/fsevents@2.3.3-fork"},"_nodeVersion":"24.10.0","dependencies":{"debug":"^4.1.1","semver":"^7.6.3","progress":"^2.0.3","env-paths":"^3.0.0","sumchecker":"^3.0.1","graceful-fs":"^4.2.11"},"publishConfig":{"provenance":true},"_hasShrinkwrap":false,"packageManager":"yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f","devDependencies":{"husky":"^9.1.7","oxfmt":"^0.44.0","oxlint":"^1.59.0","vitest":"^4.1.2","typedoc":"~0.28.0","typescript":"^6.0.2","@types/node":"~22.12.0","lint-staged":"^16.2.7","@types/debug":"^4.1.4","@types/semver":"^7.5.8","@types/progress":"^2.0.3","oxlint-tsgolint":"^0.20.0","@tsconfig/node22":"^22.0.0","@types/graceful-fs":"^4.1.9","@vitest/coverage-v8":"^4.1.2","esbuild-plugin-file-path-extensions":"^2.1.4"},"optionalDependencies":{"undici":"^7.24.4"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/get_5.1.0_1785129056115_0.21693933571285307"},"readme":"# @electron/get\n\n> 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[![API docs](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.npmjs.org%2F%40electron%2Fget%2Flatest&query=%24.version&logo=typescript&logoColor=white&label=API%20Docs\n)](https://packages.electronjs.org/get)\n\n## Usage\n\nFor full API details, see the [API documentation](https://packages.electronjs.org/get).\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 the built-in [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)\nas the downloader. As a result, you can pass [`RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit)\noptions via `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 receives a `Progress` object with `transferred`,\n`total`, and `percent` properties.\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","publish_time":1785129056194,"_cnpm_publish_time":1785129056194,"dist-tags":{"latest":"5.1.0"}}