# request-light

> Lightweight request library. Promise based, with proxy support.

Latest version **0.8.0** (published 2024-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install request-light
pnpm add request-light
yarn add request-light
bun add request-light
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.8.0 |
| Published | 2024-07-02 |
| First published | 2016-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 31.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 35 |
| Author | Microsoft Corporation |

## Links

- npm: https://www.npmjs.com/package/request-light
- Repository: https://github.com/microsoft/node-request-light
- Homepage: https://github.com/microsoft/node-request-light#readme
- Issues: https://github.com/microsoft/node-request-light/issues
- npm.io page: https://npm.io/package/request-light

## Recent versions

- 0.8.0 (latest) — 2024-07-02
- 0.7.0 — 2023-01-23
- 0.6.0 — 2022-11-03
- 0.5.8 — 2022-04-12
- 0.5.7 — 2022-01-07
- 0.5.6 — 2021-12-30
- 0.5.5 — 2021-11-17
- 0.5.4 — 2021-07-15
- 0.5.3 — 2021-07-14
- 0.5.2 — 2021-07-12
- 0.5.1 — 2021-07-12
- 0.5.0 — 2021-07-12
- 0.4.0 — 2020-06-17
- 0.3.0 — 2020-02-28
- 0.2.5 — 2019-10-30
- … 9 more at https://npm.io/package/request-light/versions

## README

# request-light


[![npm Package](https://img.shields.io/npm/v/request-light.svg?style=flat-square)](https://www.npmjs.org/package/request-light)
[![NPM Downloads](https://img.shields.io/npm/dm/request-light.svg)](https://npmjs.org/package/request-light)
[![Build Status](https://github.com/microsoft/node-request-light/workflows/Tests/badge.svg)](https://github.com/microsoft/node-request-light/workflows/Tests)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A lightweight request library intended to be used by VSCode extensions.
- NodeJS and browser main entry points
- proxy support: Use `configure` or `HTTP_PROXY` and `HTTPS_PROXY` env variables to configure the HTTP proxy addresses.

```ts
import { xhr, XHRResponse, getErrorStatusDescription } from 'request-light';

const headers = { 'Accept-Encoding': 'gzip, deflate' };
return xhr({ url: url, followRedirects: 5, headers }).then(response => {
    return response.responseText;
}, (error: XHRResponse) => {
    throw new Error(error.responseText || getErrorStatusDescription(error.status) || error.toString());
});
```

---
_Source: https://npm.io/package/request-light · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
