← All tools

ehmicky/fetch-node-website

Popularity 65 Updated Development & Build

Fetch releases on nodejs.org

githubauto-collected

Installation

A directly usable install command is not verified yet. Check the project documentation or releases.

Fetch releases on nodejs.org

Download release files available on https://nodejs.org/dist/.

Example

import fetchNodeWebsite from 'fetch-node-website'

const stream = await fetchNodeWebsite('v12.8.0/node-v12.8.0-linux-x64.tar.gz')

// Example with options
const otherStream = await fetchNodeWebsite(
  'v12.8.0/node-v12.8.0-linux-x64.tar.gz',
  {
    progress: true,
    mirror: 'https://npmmirror.com/mirrors/node',
    signal: new AbortController().signal,
  },

# Install

npm install fetch-node-website


This package works in Node.js >=18.18.0.

This is an ES module. It must be loaded using
[an `import` or `import()` statement](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c),
not `require()`. If TypeScript is used, it must be configured to
[output ES modules](https://www.typescriptlang.org/docs/handbook/esm-node.html),
not CommonJS.

# Usage

## fetchNodeWebsite(path, options?)

path: string\ options: object\ Returns: Promise<Stream

options

#### progress

Type: boolean\ Default: false

Show a progress bar.

#### mirror

Type: string\ Default: https://nodejs.org/dist

Base URL. Can be customized (for example https://npmmirror.com/mirrors/node).

The following environment variables can also be used: NODEMIRROR, NVMNODEJSORGMIRROR, NNODEMIRROR or NODISTNODEMIRROR.

#### signal

Type: AbortSignal