Downloads an Electron release zip from GitHub.
Note: Requires Node >= 4.0 to run.
$ npm install --global electron-download$ electron-download --version=0.31.1
const download =
If you don't specify
platform args it will use the built-in
os module to get the values from the current OS. Specifying
version is mandatory. If there is a
SHASUMS256.txt file available for the
version, the file downloaded will be validated against its checksum to ensure that it was downloaded without errors.
You can also use
electron-download to download the
mksnapshot, and symbols assets for a specific Electron release. This can be
configured by setting the
symbols property to
true in the specified options object. Only one of
these options may be specified per download call.
You can force a re-download of the asset and the
SHASUM file by setting the
force option to
If you would like to override the mirror location, three options are available. The mirror URL is composed as
url = ELECTRON_MIRROR + ELECTRON_CUSTOM_DIR + '/' + ELECTRON_CUSTOM_FILENAME.
You can set the
NPM_CONFIG_ELECTRON_MIRROR environment variable or
mirror opt variable to use a custom base URL for grabbing Electron zips. The same pattern applies to
## Electron Mirror of ChinaELECTRON_MIRROR=""## or for a local mirrorELECTRON_MIRROR=""ELECTRON_CUSTOM_DIR="our/internal/filePath"
You can set ELECTRON_MIRROR in
.npmrc as well, using the lowercase name:
The location of the cache depends on the operating system, the defaults are: