Socket
Socket
Sign inDemoInstall

request-light

Package Overview
Dependencies
0
Maintainers
7
Versions
23
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    request-light

Lightweight request library. Promise based, with proxy support.


Version published
Weekly downloads
415K
increased by80.5%
Maintainers
7
Install size
34.4 kB
Created
Weekly downloads
 

Readme

Source

request-light

npm Package NPM Downloads Build Status License: 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.
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());
});

FAQs

Last updated on 23 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc