global-agent-ng

1.0.0 • Public • Published

global-agent-ng

build status install size npm package version github license js semistandard style

Opinionated wrapper around global-agent

Installation

npm install global-agent-ng

Usage

As early as possible in your application, require and configure global-agent-ng.

require('global-agent-ng').config();

Preload

You can use the -r, --require command line option to preload global-agent-ng. By doing this, you do not need to require and load global-agent-ng in your application code.

node -r global-agent-ng/config script.js

Configure global-agent-ng using environment variables

The following environment variables are respected by global-agent-ng:

  • HTTP_PROXY / http_proxy
  • HTTPS_PROXY / https_proxy
  • NO_PROXY / no_proxy

API

Table of Contents

exports.agent

global proxy agent instance

Type: ProxyAgent

exports.isProxying

proxying status

Type: Boolean

config

Bootstrap global proxy agent

Parameters

Examples

// Bootstrap global proxy agent
require('global-agent-ng').config();
//=> true
 
// Global proxy agent is already bootstrapped
require('global-agent-ng').config();
//=> false

Returns Boolean bootstraping result

ProxyAgentConfig

ProxyAgent

Package Sidebar

Install

npm i global-agent-ng

Weekly Downloads

5

Version

1.0.0

License

MIT

Unpacked Size

7.14 kB

Total Files

5

Last publish

Collaborators

  • vladimyr