request-light
TypeScript icon, indicating that this package has built-in type declarations

0.7.0 • Public • Published

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());
});

Dependencies (0)

    Dev Dependencies (12)

    Package Sidebar

    Install

    npm i request-light

    Weekly Downloads

    233,299

    Version

    0.7.0

    License

    MIT

    Unpacked Size

    35.2 kB

    Total Files

    8

    Last publish

    Collaborators

    • alexandrudima
    • joaomoreno.ms
    • kaimaetzel
    • sbatten
    • microsoft1es
    • lszomoru
    • vscode-bot