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.

npm install fetch-node-website
INSTALL
IMPORT
SIG · FETCH-NODE-WEBSITE
F
fetch-node-website
devopsjavascriptv9.0.1
harness data pending
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.

default
import fetchNodeWebsite from 'fetch-node-website'
const fetchNodeWebsite = require('fetch-node-website')
ESM-only since v1. TypeScript must output ES modules.
fetchNodeWebsite
import fetchNodeWebsite from 'fetch-node-website'
import { fetchNodeWebsite } from 'fetch-node-website'
Only default export. Named import will throw.
type Options
import type { Options } from 'fetch-node-website'
import { Options } from 'fetch-node-website'
Type is exported for TypeScript usage; do not use as value.

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 issues
breakingNode.js >=18.18.0 required; older versions will not work.
fix
Upgrade Node.js to >=18.18.0. Previous major versions may support older Node.js.
affects: <9.0.0
breakingESM-only. require() will throw ERR_REQUIRE_ESM.
fix
Use import or import() instead of require().
affects: >=1.0.0
deprecatedThe 'mirror' option accepts environment variables NODE_MIRROR, NVM_NODEJS_ORG_MIRROR, N_NODE_MIRROR, NODIST_NODE_MIRROR.
fix
Prefer passing 'mirror' option directly. Env vars are still supported but not recommended.
affects: >=1.0.0
gotchaThe returned stream is a Stream (not a file path). Must pipe or consume manually.
fix
Pipe to a writable stream (e.g., fs.createWriteStream) or use stream consumers.
affects: >=1.0.0
gotchaTypeScript users must set moduleResolution to 'node16' or 'bundler' to resolve types.
fix
Configure tsconfig.json with "moduleResolution": "node16" or "bundler".
affects: >=1.0.0
Errors
Common errors & fixes
ERR_REQUIRE_ESM
Using require() on an ESM-only package.
fix
Replace require('fetch-node-website') with import fetchNodeWebsite from 'fetch-node-website'.
TypeError: fetchNodeWebsite is not a function
Named import instead of default import.
fix
Use import fetchNodeWebsite from 'fetch-node-website' instead of import { fetchNodeWebsite } from ...
Error: The "path" argument must be of type string
Path passed to fetchNodeWebsite is not a string (e.g., undefined or number).
fix
Ensure the first argument is a string like 'v12.8.0/node-v12.8.0-linux-x64.tar.gz'.
Upgrade
Version history
9.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
fetch-node-website — npm install fetch-node-website · libregistry