MCPcopy Index your code
hub / github.com/nodejs/nodejs.org / createDownloadArtifact

Function createDownloadArtifact

apps/site/util/download/archive.tsx:22–43  ·  view source on GitHub ↗
(
  os: OperatingSystem,
  platform: DownloadDropdownItem<Platform>,
  versionWithPrefix: string,
  kind: DownloadKind
)

Source from the content-addressed store, hash-verified

20 * Creates a download artifact from platform data
21 */
22const createDownloadArtifact = (
23 os: OperatingSystem,
24 platform: DownloadDropdownItem<Platform>,
25 versionWithPrefix: string,
26 kind: DownloadKind
27): DownloadArtifact => {
28 const url = getNodeDownloadUrl({
29 versionWithPrefix,
30 os,
31 platform: platform.value,
32 kind,
33 });
34
35 return {
36 fileName: url.replace(`${DIST_URL}${versionWithPrefix}/`, ''),
37 kind,
38 os,
39 architecture: platform.label,
40 url,
41 version: versionWithPrefix,
42 };
43};
44
45/**
46 * Filters platforms by compatibility and exclusions

Callers 1

getCompatibleArtifactsFunction · 0.85

Calls 1

getNodeDownloadUrlFunction · 0.90

Tested by

no test coverage detected