mrkeyoor.com_
Thu 22 Oct 00:15 UTC
npmCLI & Toolingupdated 21 Oct 2026

@electron/get review

@electron/get 5.1.0 downloads Electron release artifacts and returns an absolute file path. Your script must then extract or otherwise consume the file. Use this Node library when you own that download step and need to choose an Electron version, target or cache policy. download() selects the running Node process's platform and architecture; downloadArtifact() accepts an explicit target. For Electron 1.3.2 or newer, validating a cached archive can still require a checksum-manifest request.

Verdict

Use @electron/get when your script needs to control the Electron artifact download and cache policy. Choose who owns the returned file, verify that the release publishes your target, and account for checksum traffic. The supplied evidence supports these API decisions, but does not establish runtime compatibility or download performance.

Answers from our run

@electron/get or electron: which should you use?

electron: Choose electron when your task is building a desktop app with JavaScript, HTML and CSS. Its npm description identifies that application-building purpose; @electron/get handles the artifact-download step. Use @electron/get when your script needs to control the Electron artifact download and cache policy.

When should you not use @electron/get?

You need a complete application build. This API returns a downloaded file; extraction, packaging and installation require separate steps.

API stability3/5Documentation-based API rubric: 1 means an unclear callable contract, 3 means inspectable exports and options with stated adoption constraints, and 5 requires migration and compatibility evidence. The 5.1.0 metadata declares ESM, ./dist/index.js and Node >=22.12.0. The pinned source exposes the download functions and cache-mode enum. This supports 3, without establishing stability across major versions or compatibility with existing CommonJS projects.
Docs4/5Documentation rubric: 1 states a purpose, 3 explains basic calls, 4 explains the operational choices covered here, and 5 supports the full workflow without unresolved questions. The declarations describe target fields, checksum maps, cache modes and returned-file ownership; the implementation shows validation and cache-hit handling. That supports 4 for this focused workflow. Proxy configuration, mirrors and failure recovery have no supplied execution results.
Maintenance3/5Release-evidence rubric: 1 lacks traceable release evidence, 3 has a version-linked change addressing a concrete constraint, and 5 requires a broader record of releases and resolved problems. The 5.1.0 release note documents an error for win32/ia32 and linux/armv7l downloads of Electron >=44. Its commit matches the npm gitHead and supplied implementation. This supports 3 for traceability, without inferring response times or future support.
Ecosystem3/5Integration-documentation rubric: 1 leaves the integration task unclear, 3 documents useful integration choices, and 5 requires independently checked breadth across consumers and environments. The supplied types describe platform-specific and generic artifacts, cache roots, four cache modes and supplied checksums. Those choices support controlled Node download scripts. The score is 3 for that documented scope; adoption, cross-platform execution and complete release-pipeline compatibility remain unmeasured.

Use it if

  • Your Node build script needs a downloaded Electron ZIP path before a separate extraction or installation step.
  • You need to request an artifact for a platform and architecture different from the process running the download.
  • CI needs an explicit cache policy, such as reading a prepared cache without adding artifacts to it.
  • You have trusted artifact checksums and want to supply them instead of downloading a checksum manifest for Electron 1.3.2 or newer.
Skip it if

Setup reality

Start with Node 22.12.0 or newer and install the package in the project that owns the download step: npm install --save-dev @electron/get@5.1.0. The npm version metadata declares an ESM package with ./dist/index.js as its export. Save each recipe as a separate .mjs file and pass a published Electron version as the first argument, for example node get-electron.mjs YOUR_RELEASE_VERSION.

The evidence reviewed here consists of npm version metadata and version-pinned source extracts. There is no supplied archive-inspection or execution record. These recipes are source-based illustrations; they were not executed for this correction. No dependency installation, Electron binary download, timing result, platform trial or concurrency result is established by the supplied evidence.

Choose the target before the cache policy. download() sets platform to process.platform and arch to process.arch after spreading its options. Use downloadArtifact() with top-level platform and arch fields for another target. Requesting an archive does not establish that it runs on the build host or that the chosen release publishes that target.

ReadWrite is the documented default. ReadWrite and WriteOnly return paths into the disk cache, so copy those files if another step needs to move or delete them. ReadOnly and Bypass assign cleanup of the returned file to the caller. ReadOnly can download a missing artifact without adding it to the cache. On a cache hit, the implementation copies the artifact into a temporary directory before validation and return.

ReadOnly is not an offline switch. For Electron 1.3.2 or newer, the implementation validates ordinary artifacts unless unsafelyDisableChecksums is enabled. Without supplied checksums, validation requests SHASUMS256.txt with Bypass. A trusted, nonempty checksums map replaces that manifest request while retaining validation. It neither supplies a missing archive nor establishes that all network access is gone. The implementation skips this checksum validation for older Electron versions and for artifact names beginning with SHASUMS256.

Extraction remains separate. The supplied @electron-internal/extract-zip guide addresses that extractor's support boundary. For release packaging, signing or publishing, consult the supplied electron-builder guide. An archive path and checksum comparison do not establish a working desktop installation.

The ratings use documentation-based rubrics stated in each rationale. They are editorial judgments about the supplied evidence, not benchmark or compatibility results.

Patterns

Get the ZIP for the running Node process download-host-archive

import { download } from '@electron/get';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const zipPath = await download(version);
console.log(zipPath);

Unexecuted source-based illustration for 5.1.0, as are all recipes on this page. download() selects process.platform and process.arch and returns an absolute ZIP path. Extraction remains separate. Leave the default cache-owned file in place.

Request Linux x64 explicitly request-other-platform

import { downloadArtifact } from '@electron/get';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const zipPath = await downloadArtifact({
  version,
  artifactName: 'electron',
  platform: 'linux',
  arch: 'x64',
});
console.log(zipPath);

Use top-level target fields on downloadArtifact(). download() sets platform and arch from the running process. This requests an artifact; it does not run the binary or establish that the requested release publishes it.

Put the archive cache under your build workspace choose-cache-root

import { download } from '@electron/get';
import { resolve } from 'node:path';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const zipPath = await download(version, {
  cacheRoot: resolve('.cache/electron-artifacts'),
});
console.log(zipPath);

cacheRoot selects the artifact cache directory. Preserve or copy the default-mode returned file because it points into that cache. This option neither selects an extraction directory nor disables checksum-manifest requests.

Take ownership of a temporary download bypass-shared-cache

import { download, ElectronDownloadCacheMode } from '@electron/get';
import { copyFile, rm } from 'node:fs/promises';
import { dirname, resolve } from 'node:path';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const temporaryPath = await download(version, {
  cacheMode: ElectronDownloadCacheMode.Bypass,
});
try {
  await copyFile(temporaryPath, resolve('electron-download.zip'));
} finally {
  await rm(dirname(temporaryPath), { recursive: true, force: true });
}

Bypass neither reads nor writes the artifact cache. The caller owns cleanup of the returned temporary file. This illustration copies it, then removes its temporary directory. The fixed destination can overwrite an existing file; choose a destination suitable for your job.

Read a prepared cache without adding artifacts read-without-populating-cache

import { download, ElectronDownloadCacheMode } from '@electron/get';
import { copyFile, rm } from 'node:fs/promises';
import { dirname, resolve } from 'node:path';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const temporaryPath = await download(version, {
  cacheRoot: resolve('.cache/electron-artifacts'),
  cacheMode: ElectronDownloadCacheMode.ReadOnly,
});
try {
  await copyFile(temporaryPath, resolve('electron-readonly.zip'));
} finally {
  await rm(dirname(temporaryPath), { recursive: true, force: true });
}

ReadOnly can fetch a missing artifact without writing it into the cache. On a hit, the implementation copies the cached file into a caller-owned temporary directory. This illustration removes that directory after copying; its destination can overwrite an existing file. For Electron 1.3.2 or newer, checksum validation can still require a manifest request.

Fetch again and update the artifact cache refresh-cache-entry

import { download, ElectronDownloadCacheMode } from '@electron/get';
import { resolve } from 'node:path';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const cachedPath = await download(version, {
  cacheRoot: resolve('.cache/electron-artifacts'),
  cacheMode: ElectronDownloadCacheMode.WriteOnly,
});
console.log(cachedPath);

The enum documents WriteOnly as skipping cache reads and writing the fetched artifact into the cache, overwriting its entry. The returned path points into the cache, so leave it there. No shared-cache concurrency result is supplied.

Provide checksums you already trust supply-trusted-checksums

import { download } from '@electron/get';
import { readFile } from 'node:fs/promises';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const checksums = JSON.parse(
  await readFile('trusted-checksums.json', 'utf8'),
);
const zipPath = await download(version, { checksums });
console.log(zipPath);

Provide trusted-checksums.json as a nonempty object mapping exact artifact filenames to trusted SHA-256 strings, including the ZIP for the selected version and process target. For Electron 1.3.2 or newer, validation generates its checksum manifest from this map instead of fetching one. The implementation skips checksum validation for older releases. This recipe neither authenticates the map's origin nor guarantees offline operation.

Download a release checksum manifest request-generic-manifest

import { downloadArtifact } from '@electron/get';
import { readFile } from 'node:fs/promises';

const version = process.argv[2];
if (!version) throw new Error('Pass a published Electron version');

const manifestPath = await downloadArtifact({
  version,
  isGeneric: true,
  artifactName: 'SHASUMS256.txt',
});
console.log(await readFile(manifestPath, 'utf8'));

Generic artifacts do not require platform or arch. This explicit request uses the default cache policy, unlike the internal validation request that sets Bypass. Artifact names beginning with SHASUMS256 skip checksum validation, so obtaining this text does not independently authenticate it. Leave its default cache-owned path in place.

Alternatives

PackageRegistryPick it when
electronnpmChoose electron when your task is building a desktop app with JavaScript, HTML and CSS. Its npm description identifies that application-building purpose; @electron/get handles the artifact-download step.
@electron/packagernpmChoose @electron/packager when you need to package an Electron app into OS-specific bundles through JavaScript or a CLI. Its npm description identifies that packaging purpose, which follows obtaining the Electron archive.

More cli & tooling guides

commander · chalk · click · typescript · esbuild · yargs · the whole shelf →

How this guide is made: grounded in the library's documentation, release notes, changelog, and issue history, on a fixed rubric — not a hands-on install of every release. The 50 most-downloaded entries are additionally install-verified in clean containers. Corrections: contact the desk.