Interface ElectronPlatformArtifactDetailsWithDefaults

Options to download a platform and architecture-specific Electron artifact. Contains all options from ElectronDownloadRequestOptions, but specifies a version and artifactName for the artifact to download.

If platform and arch are omitted, they will be inferred using the host system platform and architecture.

interface ElectronPlatformArtifactDetailsWithDefaults {
    artifactName: string;
    version: string;
    arch?: string;
    artifactSuffix?: string;
    cacheMode?: ElectronDownloadCacheMode;
    cacheRoot?: string;
    checksums?: Record<string, string>;
    downloadOptions?: any;
    downloader?: Downloader<any>;
    isGeneric?: false;
    mirrorOptions?: MirrorOptions;
    platform?: string;
    tempDirectory?: string;
    unsafelyDisableChecksums?: boolean;
}

Properties

artifactName: string

The type of artifact. For example:

  • electron
  • ffmpeg
version: string

The version of Electron associated with the artifact.

arch?: string

The target artifact architecture. These are Node-style architecture names, for example:

  • ia32
  • x64
  • armv7l

See

Node.js process.arch docs

artifactSuffix?: string

Controls the cache read and write behavior.

When set to either ReadOnly or Bypass, the caller is responsible for cleaning up the returned file path once they are done using it (e.g. via fs.remove(path.dirname(pathFromElectronGet))).

When set to either WriteOnly or ReadWrite (the default), the caller should not move or delete the file path that is returned as the path points directly to the disk cache.

Default Value

{@link ElectronDownloadCacheMode.ReadWrite}
cacheRoot?: string

The directory that caches Electron artifact downloads.

Default Value

The default value is dependent upon the host platform:

  • Linux: $XDG_CACHE_HOME or ~/.cache/electron/
  • MacOS: ~/Library/Caches/electron/
  • Windows: %LOCALAPPDATA%/electron/Cache or ~/AppData/Local/electron/Cache/
checksums?: Record<string, string>

Provides checksums for the artifact as strings. Can be used if you already know the checksums of the Electron artifact you are downloading and want to skip the checksum file download without skipping the checksum validation.

This should be an object whose keys are the file names of the artifacts and the values are their respective SHA256 checksums.

Example

{
"electron-v4.0.4-linux-x64.zip": "877617029f4c0f2b24f3805a1c3554ba166fda65c4e88df9480ae7b6ffa26a22"
}
downloadOptions?: any

Options passed to the downloader module.

See

GotDownloaderOptions for options for the default GotDownloader.

downloader?: Downloader<any>

A custom Downloader class used to download artifacts. Defaults to the built-in GotDownloader.

isGeneric?: false
mirrorOptions?: MirrorOptions

Options related to specifying an artifact mirror.

platform?: string

The target artifact platform. These are Node-style platform names, for example:

  • win32
  • darwin
  • linux

See

Node.js process.platform docs

tempDirectory?: string

A temporary directory for downloads. It is used before artifacts are put into cache.

Default Value

the OS default temporary directory via os.tmpdir()

unsafelyDisableChecksums?: boolean

When set to true, disables checking that the artifact download completed successfully with the correct payload.

Default Value

false