Registry / devops / fetch-node-website

fetch-node-website

JSON →
library9.0.1jsnpmunverified

Programmatic utility to download release files from nodejs.org, such as tarballs or zips, by their version path. Current version is 9.0.1, works on Node.js >=18.18.0, ships TypeScript types, and is ESM-only. Supports progress bars, custom mirrors (e.g., npmmirror.com), and abort signals. The simplest way to fetch Node.js binaries without shelling out to nvm or curl. Maintained by the author of nve and get-node. Releases follow semver; no major breaking changes since v1.

devops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ESM-only since v1. TypeScript must output ES modules.

import fetchNodeWebsite from 'fetch-node-website'

Only default export. Named import will throw.

import fetchNodeWebsite from 'fetch-node-website'

Type is exported for TypeScript usage; do not use as value.

import type { Options } from 'fetch-node-website'

Fetches a Node.js release tarball and saves it to disk, with optional mirror and progress bar.

import fetchNodeWebsite from 'fetch-node-website'; import { createWriteStream } from 'fs'; // Fetch Node.js v12.8.0 Linux x64 tarball const stream = await fetchNodeWebsite('v12.8.0/node-v12.8.0-linux-x64.tar.gz'); // Pipe to a file stream.pipe(createWriteStream('./node-v12.8.0-linux-x64.tar.gz')); // With custom mirror and progress bar const stream2 = await fetchNodeWebsite( 'v12.8.0/node-v12.8.0-linux-x64.tar.gz', { progress: true, mirror: 'https://npmmirror.com/mirrors/node', signal: AbortSignal.timeout(10000), } ); stream2.pipe(createWriteStream('./node-v12.8.0-linux-x64.tar.gz'));
Debug
Known footguns
breakingNode.js >=18.18.0 required; older versions will not work.
breakingESM-only. require() will throw ERR_REQUIRE_ESM.
deprecatedThe 'mirror' option accepts environment variables NODE_MIRROR, NVM_NODEJS_ORG_MIRROR, N_NODE_MIRROR, NODIST_NODE_MIRROR.
gotchaThe returned stream is a Stream (not a file path). Must pipe or consume manually.
gotchaTypeScript users must set moduleResolution to 'node16' or 'bundler' to resolve types.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources