1.0.1 • Published 11 months ago

@totallynodavid/proxy-wrapper v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
11 months ago

proxy-wrapper

A lightweight proxy wrapper for fetch requests.

Installation

npm i @totallynodavid/proxy-wrapper

Setup

  1. Create an .env file in your project root:
PROXY_HOST=your_proxy_host
PROXY_PORT=your_proxy_port
PROXY_USERNAME=your_proxy_username
PROXY_PASSWORD=your_proxy_password

Usage

import {withProxy} from 'fast-proxy-wrapper';

const originalFunction = async () => {
    const response = await fetch('https://api.example.com/data');
    return response.json();
};

const proxiedFunction = withProxy(originalFunction);
1.0.1

11 months ago

1.0.0

11 months ago