{"name":"@electron/get","version":"4.0.3","type":"module","exports":"./dist/index.js","description":"Utility for downloading artifacts from different versions of Electron","repository":{"type":"git","url":"git+https://github.com/electron/get.git"},"author":{"name":"Samuel Attard"},"license":"MIT","publishConfig":{"provenance":true},"scripts":{"build":"tsc","build:docs":"npx typedoc","eslint":"eslint --ext .ts src test","lint":"npm run prettier && npm run eslint","prepare":"husky","prettier":"prettier --check \"src/**/*.ts\" \"test/**/*.ts\"","prettier:write":"prettier --write \"src/**/*.ts\" \"test/**/*.ts\"","prepublishOnly":"npm run build","test":"vitest run --coverage","test:nonetwork":"npm run lint && vitest run --coverage --testPathIgnorePatterns network.spec"},"engines":{"node":">=22.12.0"},"dependencies":{"debug":"^4.1.1","env-paths":"^3.0.0","got":"^14.4.5","graceful-fs":"^4.2.11","progress":"^2.0.3","semver":"^7.6.3","sumchecker":"^3.0.1"},"devDependencies":{"@tsconfig/node22":"^22.0.0","@types/debug":"^4.1.4","@types/graceful-fs":"^4.1.9","@types/node":"~22.10.5","@types/progress":"^2.0.3","@types/semver":"^7.5.8","@typescript-eslint/eslint-plugin":"^8.19.1","@typescript-eslint/parser":"^8.0.0","@vitest/coverage-v8":"3.0.5","esbuild-plugin-file-path-extensions":"^2.1.4","eslint":"^8.57.0","eslint-config-prettier":"^6.15.0","eslint-plugin-import":"^2.31.0","husky":"^9.1.7","lint-staged":"^16.2.7","prettier":"^3.4.2","typedoc":"~0.25.13","typescript":"~5.4.5","vitest":"^3.0.5"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.ts":["eslint --fix","prettier --write"]},"keywords":["electron","download","prebuild","get","artifact","release"],"optionalDependencies":{"global-agent":"^3.0.0"},"packageManager":"yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f","gitHead":"5abedec50330091b73e07bce57bbeb6ce03d3e09","_id":"@electron/get@4.0.3","bugs":{"url":"https://github.com/electron/get/issues"},"homepage":"https://github.com/electron/get#readme","_nodeVersion":"24.10.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-HgUXcnXF37bz26gvhx47f6g0hfI3tccxbTjG+SyKXaaSE3QapDzUF3bpxfgu+x5D+jtarNrpLCWlYARfZzirAQ==","shasum":"6007ebded59652102fe7cf7083891a191727aefd","tarball":"http://registry-npm.ywwl.com/@electron/get/download/@electron/get-4.0.3.tgz","fileCount":30,"unpackedSize":68285,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@electron%2fget@4.0.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCCdfXt1qsViujtMxjjYjcaVXKOQqUBN+nm+mPDSB7D1wIhAKlZMR0JuxHXX9eW1hUmwlOMyhsZ7YNfb3yu14crGiXH"}],"size":19428,"noattachment":false,"key":"/@electron/get/-/@electron/get-4.0.3.tgz"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:cc90f928-3957-42c6-a68d-3af08afad019"}},"directories":{},"maintainers":[{"name":"electron-cfa","email":"info+cfa-npm@electronjs.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/get_4.0.3_1774481429845_0.03762761241938506"},"_hasShrinkwrap":false,"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 [`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","publish_time":1774481429988,"_cnpm_publish_time":1774481429988,"dist-tags":{"latest":"5.1.0"}}