agent-base
npmv9.0.0Turn a function into an `http.Agent` instance
Safe to adopt
Yes — agent-base scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 162 days ago. 5 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- BMaintenance: grade B, Good.
Last published 162 days ago. 5 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 21 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding agent-base to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node >= 20
- Module format
- ESM only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the agent-base README.
import * as net from 'net';
import * as tls from 'tls';
import * as http from 'http';
import { Agent } from 'agent-base';
class MyAgent extends Agent {
connect(req, opts) {
// `secureEndpoint` is true when using the "https" module
if (opts.secureEndpoint) {
return tls.connect(opts);
} else {
return net.connect(opts);
}
}agent-base vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| agent-basethis page | 0 | 6 | MIT | 5 months ago |
| socks-proxy-agent | 0 | 3 | MIT | 1 day ago |
| pac-proxy-agent | 0 | 1 | MIT | 1 day ago |
| proxy-agent | 0 | 1 | MIT | 1 day ago |
| https-proxy-agent | 225.1M | 10 | MIT | 1 day ago |
| undici | 158.5M | 15 | MIT | 1 day ago |
Dependencies
Declared by agent-base v9.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (8)
Used by
Popular packages that depend on agent-base.
An HTTP(s) proxy `http.Agent` implementation for HTTPS
An HTTP(s) proxy `http.Agent` implementation for HTTP
Maps proxy protocols to `http.Agent` implementations
A PAC file proxy `http.Agent` implementation for HTTP
A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
the http/https agent used by the npm cli
Relationship graph
Dependencies (left) and dependents (right) of agent-base.
Frequently installed together
Lightweight debugging utility for Node.js and the browser
TypeScript definitions for debug
TypeScript definitions for node
An HTTP(s) proxy `http.Agent` implementation for HTTPS
An HTTP(s) proxy `http.Agent` implementation for HTTP
A SOCKS proxy `http.Agent` implementation for HTTP and HTTPS
Negotiate/SPNEGO proxy authentication for proxy-agents
Fully featured SOCKS proxy client supporting SOCKSv4, SOCKSv4a, and SOCKSv5. Includes Bind and Associate functionality.
An implementation of window.fetch in Node.js using Minipass streams
Offers getProxyForUrl to get the proxy URL for a URL, respecting the *_PROXY (e.g. HTTP_PROXY) and NO_PROXY environment variables.
TypeScript definitions for ws
A library for parsing IPv4 and IPv6 IP addresses in node and the browser.
Release history
5 releases in the last two years, typically about 113 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 9.0.0latest | 5 months ago | 21 KB | MIT |
| 8.0.0 | 6 months ago | 21 KB | MIT |
| 7.1.4 | 1 year ago | 31 KB | MIT |
| 7.1.3 | 1 year ago | 31 KB | MIT |
| 7.1.2 | 1 year ago | 31 KB | MIT |
| 7.1.1 | 2 years ago | 31 KB | MIT |
| 7.1.0 | 3 years ago | 23 KB | MIT |
| 7.0.2 | 3 years ago | 23 KB | MIT |
| 7.0.1 | 3 years ago | 20 KB | MIT |
| 7.0.0 | 3 years ago | 23 KB | MIT |
| 6.0.2 | 5 years ago | 34 KB | MIT |
| 6.0.1 | 6 years ago | 33 KB | MIT |
| 6.0.0 | 6 years ago | 24 KB | MIT |
| 5.1.1 | 6 years ago | 23 KB | MIT |
| 5.1.0 | 6 years ago | 23 KB | MIT |
Overview
agent-base is an npm package that turn a function into an `http.Agent` instance. It has 6 known dependents in the graph. The latest version is 9.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need turn a function into an `http.Agent` instance and value a focused solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use agent-base?
Yes — agent-base scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 162 days ago. 5 releases in the last 2 years.
How do I install agent-base?
Run `npm install agent-base` to add agent-base to your npm project.
What license is agent-base released under?
agent-base is distributed under the MIT license.
How popular is agent-base?
npm does not publish download counts. Within PackageGraph's crawl, 6 known packages depend on agent-base.
Is agent-base still maintained?
The most recent release of agent-base (v9.0.0) was published 5 months ago.
Does agent-base run install scripts?
No. agent-base does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.