Never Perfectly Managed

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

    0.5.8 • Public • Published

    request-light

    npm Package NPM Downloads Build Status

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

    Keywords

    none

    Install

    npm i request-light

    DownloadsWeekly Downloads

    164,141

    Version

    0.5.8

    License

    MIT

    Unpacked Size

    30.1 kB

    Total Files

    7

    Last publish

    Collaborators

    • jrieken
    • egamma
    • chrisdias
    • alexandrudima
    • aeschli
    • dbaeumer
    • bpasero
    • isidor
    • joaomoreno.ms
    • aweinand