Comprehensive function for downloading any Electron release artifact with full control over platform, architecture, and artifact type. This enables downloading symbols, headers, FFmpeg, and other specialized artifacts.
Downloads an artifact from an Electron release and returns an absolute path to the downloaded file.
/**
* Downloads an artifact from an Electron release and returns an absolute path
* to the downloaded file.
*
* Each release of Electron comes with artifacts, many of which are
* platform/arch-specific (e.g. `ffmpeg-v31.0.0-darwin-arm64.zip`) and others that
* are generic (e.g. `SHASUMS256.txt`).
*
* @param artifactDetails - The information required to download the artifact
*/
function downloadArtifact(
artifactDetails: ElectronPlatformArtifactDetailsWithDefaults | ElectronGenericArtifactDetails
): Promise<string>;For platform and architecture-specific artifacts:
type ElectronPlatformArtifactDetailsWithDefaults = {
version: string;
artifactName: string;
platform?: string;
arch?: string;
artifactSuffix?: string;
isGeneric?: false;
} & ElectronDownloadRequestOptions;Usage Examples:
import { downloadArtifact } from "@electron/get";
// Download Electron symbols for macOS x64
const symbolsPath = await downloadArtifact({
version: '31.0.0',
platform: 'darwin',
arch: 'x64',
artifactName: 'electron',
artifactSuffix: 'symbols'
});
// Download FFmpeg for Windows x64
const ffmpegPath = await downloadArtifact({
version: '31.0.0',
platform: 'win32',
arch: 'x64',
artifactName: 'ffmpeg'
});
// Download for current platform (defaults applied)
const electronPath = await downloadArtifact({
version: '31.0.0',
artifactName: 'electron'
// platform and arch will default to current system
});
// Download with custom options
const headersPath = await downloadArtifact({
version: '31.0.0',
platform: 'linux',
arch: 'x64',
artifactName: 'node-headers',
cacheMode: ElectronDownloadCacheMode.WriteOnly,
mirrorOptions: {
mirror: 'https://internal-mirror.company.com/electron/'
}
});For platform-agnostic artifacts:
type ElectronGenericArtifactDetails = {
isGeneric: true;
version: string;
artifactName: string;
} & ElectronDownloadRequestOptions;Usage Examples:
// Download checksums file
const checksumsPath = await downloadArtifact({
isGeneric: true,
version: '31.0.0',
artifactName: 'SHASUMS256.txt'
});
// Download release notes
const notesPath = await downloadArtifact({
isGeneric: true,
version: '31.0.0',
artifactName: 'RELEASES.md'
});electron - Main Electron binary (default)ffmpeg - FFmpeg library for media supportchromedriver - ChromeDriver for automated testingmksnapshot - V8 snapshot generation toolsymbols - Debug symbolsdsym - macOS debug symbols (dSYM bundle)pdb - Windows program database filesSHASUMS256.txt - SHA256 checksums for verificationRELEASES.md - Release notes and changelogwin32 - Windowsdarwin - macOSlinux - Linuxx64 - 64-bit Intel/AMDia32 - 32-bit Intel/AMD (deprecated for Linux)arm64 - 64-bit ARM (Apple Silicon)armv7l - 32-bit ARM v7When platform or arch are omitted:
platform defaults to process.platformarch defaults to the host architecture (via getHostArch())Platform-specific artifacts follow the pattern:
{artifactName}-v{version}-{platform}-{arch}[-{artifactSuffix}].zipExamples:
electron-v31.0.0-darwin-x64.zipffmpeg-v31.0.0-linux-arm64.zipelectron-v31.0.0-win32-x64-symbols.zip