Gathering detailed insights and metrics for agent-base
Gathering detailed insights and metrics for agent-base
Gathering detailed insights and metrics for agent-base
Gathering detailed insights and metrics for agent-base
@types/agent-base
Stub TypeScript definitions entry for agent-base, which provides its own types definitions
@agent-base/types
Shared agent types and utilities
@agent-base/api-client
Typed API clients for inter-service communication
puppeteer-extra-plugin
Base class for puppeteer-extra plugins.
npm install agent-base
Typescript
Module System
Min. Node Version
Node Version
NPM Version
98.7
Supply Chain
89.5
Quality
77.7
Maintenance
100
Vulnerability
100
License
pac-proxy-agent@7.2.0
Updated on Feb 18, 2025
agent-base@7.1.3
Updated on Dec 08, 2024
socks-proxy-agent@8.0.5
Updated on Dec 07, 2024
proxy-agent@6.5.0
Updated on Dec 07, 2024
pac-proxy-agent@7.1.0
Updated on Dec 07, 2024
https-proxy-agent@7.0.6
Updated on Dec 07, 2024
TypeScript (93.57%)
JavaScript (6.43%)
Total Downloads
11,265,321,854
Last Day
4,803,858
Last Week
84,991,146
Last Month
365,016,491
Last Year
3,717,284,486
1,060 Stars
298 Commits
258 Forks
19 Watchers
3 Branches
40 Contributors
Updated on Jul 01, 2025
Minified
Minified + Gzipped
Latest Version
7.1.3
Package Id
agent-base@7.1.3
Unpacked Size
30.81 kB
Size
7.66 kB
File Count
12
NPM Version
10.8.2
Node Version
20.18.1
Published on
Dec 08, 2024
Cumulative downloads
Total Downloads
Last Day
-3.9%
4,803,858
Compared to previous day
Last Week
-6.6%
84,991,146
Compared to previous week
Last Month
2.9%
365,016,491
Compared to previous month
Last Year
41.8%
3,717,284,486
Compared to previous year
http.Agent
instanceThis module is a thin wrapper around the base http.Agent
class.
It provides an abstract class that must define a connect()
function,
which is responsible for creating the underlying socket that the HTTP
client requests will use.
The connect()
function may return an arbitrary Duplex
stream, or
another http.Agent
instance to delegate the request to, and may be
asynchronous (by defining an async
function).
Instances of this agent can be used with the http
and https
modules. To differentiate, the options parameter in the connect()
function includes a secureEndpoint
property, which can be checked
to determine what type of socket should be returned.
Here are some more interesting uses of agent-base
.
Send a pull request to list yours!
http-proxy-agent
: An HTTP(s) proxy http.Agent
implementation for HTTP endpointshttps-proxy-agent
: An HTTP(s) proxy http.Agent
implementation for HTTPS endpointspac-proxy-agent
: A PAC file proxy http.Agent
implementation for HTTP and HTTPSsocks-proxy-agent
: A SOCKS proxy http.Agent
implementation for HTTP and HTTPSHere's a minimal example that creates a new net.Socket
or tls.Socket
based on the secureEndpoint
property. This agent can be used with both
the http
and https
modules.
1import * as net from 'net'; 2import * as tls from 'tls'; 3import * as http from 'http'; 4import { Agent } from 'agent-base'; 5 6class MyAgent extends Agent { 7 connect(req, opts) { 8 // `secureEndpoint` is true when using the "https" module 9 if (opts.secureEndpoint) { 10 return tls.connect(opts); 11 } else { 12 return net.connect(opts); 13 } 14 } 15}); 16 17// Keep alive enabled means that `connect()` will only be 18// invoked when a new connection needs to be created 19const agent = new MyAgent({ keepAlive: true }); 20 21// Pass the `agent` option when creating the HTTP request 22http.get('http://nodejs.org/api/', { agent }, (res) => { 23 console.log('"response" event!', res.headers); 24 res.pipe(process.stdout); 25});
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
Found 13/23 approved changesets -- score normalized to 5
Reason
9 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
license file not detected
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More