@hyperttp/core 1.3.3 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Core/HyperCore.d.ts +142 -152
- package/Core/HyperCore.d.ts.map +1 -1
- package/Core/HyperCore.js +289 -286
- package/Core/HyperCore.js.map +1 -1
- package/README.md +279 -134
- package/package.json +14 -8
- package/transports/browser.d.ts +228 -0
- package/transports/browser.d.ts.map +1 -0
- package/transports/browser.js +451 -0
- package/transports/browser.js.map +1 -0
- package/transports/manager.d.ts +7 -67
- package/transports/manager.d.ts.map +1 -1
- package/transports/manager.js +138 -145
- package/transports/manager.js.map +1 -1
- package/transports/node.d.ts +0 -20
- package/transports/node.d.ts.map +1 -1
- package/transports/node.js +104 -48
- package/transports/node.js.map +1 -1
- package/utils/decompress.d.ts +16 -18
- package/utils/decompress.d.ts.map +1 -1
- package/utils/decompress.js +143 -63
- package/utils/decompress.js.map +1 -1
- package/utils/errors.d.ts +0 -10
- package/utils/errors.d.ts.map +1 -1
- package/utils/errors.js +1 -11
- package/utils/errors.js.map +1 -1
- package/utils/merge.d.ts +0 -3
- package/utils/merge.d.ts.map +1 -1
- package/utils/merge.js +0 -4
- package/utils/merge.js.map +1 -1
- package/utils/normalize.d.ts +40 -20
- package/utils/normalize.d.ts.map +1 -1
- package/utils/normalize.js +197 -63
- package/utils/normalize.js.map +1 -1
- package/utils/pipeline.d.ts +10 -30
- package/utils/pipeline.d.ts.map +1 -1
- package/utils/pipeline.js +44 -44
- package/utils/pipeline.js.map +1 -1
- package/utils/response.d.ts +35 -44
- package/utils/response.d.ts.map +1 -1
- package/utils/response.js +228 -69
- package/utils/response.js.map +1 -1
- package/utils/retryUtils.d.ts +2 -10
- package/utils/retryUtils.d.ts.map +1 -1
- package/utils/retryUtils.js +17 -21
- package/utils/retryUtils.js.map +1 -1
package/Core/HyperCore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HyperCore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AAE,MAAM,CAAC,CAAC,CAAC;IACxE,CAAC;CACF"}
|
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
> English | [Русский](https://github.com/IT-IF-OR/hyperttp-core/tree/main/lang/ru)
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/@hyperttp/core)
|
|
6
|
+
[](https://www.npmjs.com/package/@hyperttp/core)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://www.typescriptlang.org/)
|
|
9
|
+
|
|
5
10
|
---
|
|
6
11
|
|
|
7
12
|
## 🌐 Language
|
|
@@ -11,140 +16,73 @@
|
|
|
11
16
|
|
|
12
17
|
---
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
It is built as a highly optimized, thin core featuring an intelligent transport layer and an advanced
|
|
16
|
-
pipeline‑based plugin architecture.
|
|
17
|
-
|
|
18
|
-
## 🔥 Key Features
|
|
19
|
+
## 🔗 Quick Links
|
|
19
20
|
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
- **🔀 Intelligent Isomorphism:** Automatically switches between optimal underlying transports (Native Bun, Undici,
|
|
25
|
-
or Node.js native `http`) while maintaining a unified, clean API.
|
|
26
|
-
- **🔌 Multi-Stage Hooks & Pipelines:** Granular control over the request lifecycle with sorted hook priorities
|
|
27
|
-
and short-circuit capabilities.
|
|
28
|
-
- **🗜️ Transparent Decompression:** Automatic out-of-the-box handling of `gzip`, `deflate`, and `br` (Brotli)
|
|
29
|
-
content-encodings for both standard `Uint8Array` buffers and `ReadableStream` data.
|
|
30
|
-
- **💎 Prototype Preservation:** Safe internal mapping that respects and carries forward custom prototypes passed
|
|
31
|
-
via request configurations.
|
|
21
|
+
- 🏢 **Organization:** [github.com/IT-IF-OR](https://github.com/IT-IF-OR)
|
|
22
|
+
- 👤 **Author:** [github.com/dirold2](https://github.com/dirold2)
|
|
23
|
+
- 📦 **npm:** [npmjs.com/org/hyperttp](https://www.npmjs.com/org/hyperttp)
|
|
24
|
+
- 🚀 **High-level client:** [`hyperttp`](https://www.npmjs.com/package/hyperttp) (all plugins pre-wired)
|
|
32
25
|
|
|
33
26
|
---
|
|
34
27
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
1. **Request Pipeline (`onRequest`):** Intercepts configurations before execution. Supports **short-circuiting**—
|
|
40
|
-
if a hook returns a response, the actual network transport layer is bypassed.
|
|
41
|
-
2. **Transport Execution (`HyperTransport`):** The underlying engine (e.g., Undici, Bun) processes the low-level
|
|
42
|
-
socket request.
|
|
43
|
-
3. **Response Data Pipeline (`onResponseData`):** Transforms or intercepts raw transport responses directly before
|
|
44
|
-
mapping and extraction.
|
|
45
|
-
4. **Internal Processing:** Transparent decompression is applied to raw buffers or streams.
|
|
46
|
-
5. **Response Pipeline (`onResponse`):**
|
|
28
|
+
**@hyperttp/core** is the low-level, high-performance engine of the Hyperttp ecosystem.
|
|
29
|
+
It provides a thin, optimized HTTP core with an intelligent transport layer and an advanced
|
|
30
|
+
pipeline-based plugin architecture — the foundation upon which the feature-rich [`hyperttp`](https://www.npmjs.com/package/hyperttp) client is built.
|
|
47
31
|
|
|
48
|
-
|
|
49
|
-
- **Side Effects / Background:** Runs parallel processing or logging blocks if `plugin.mode === "background"`.
|
|
50
|
-
|
|
51
|
-
6. **Error Pipeline (`onError`):** Catches connection drops, invalid parses, or protocol errors, allowing plugins
|
|
52
|
-
to recover and gracefully fallback to alternative responses.
|
|
32
|
+
> 💡 **Looking for a batteries-included client?** Install [`hyperttp`](https://www.npmjs.com/package/hyperttp) instead — it wraps `@hyperttp/core` with caching, rate limiting, queueing, parsing, and more.
|
|
53
33
|
|
|
54
34
|
---
|
|
55
35
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
### Test Configuration
|
|
59
|
-
|
|
60
|
-
```txt
|
|
61
|
-
Requests 20000
|
|
62
|
-
Concurrency 200
|
|
63
|
-
Duration 20000
|
|
64
|
-
Timeout 60000 ms
|
|
65
|
-
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
To run your own suite:
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
bun run bench.ts && npx tsx bench.ts
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Node.js v24.14.1 — UndiciTransport
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
npm install @hyperttp/transport-undici
|
|
79
|
-
```
|
|
36
|
+
## 🔥 Key Features
|
|
80
37
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
| 6 | ky | 6.44K | 30.97 ms | 28.38 ms | 36.48 ms | 64.38 ms | 0 |
|
|
89
|
-
| 7 | axios | 4.99K | 39.97 ms | 38.81 ms | 43.82 ms | 51.39 ms | 0 |
|
|
90
|
-
| 8 | node-fetch | 4.61K | 43.28 ms | 41.23 ms | 49.00 ms | 63.58 ms | 0 |
|
|
91
|
-
| 9 | got | 4.61K | 43.33 ms | 41.42 ms | 47.81 ms | 64.51 ms | 0 |
|
|
92
|
-
| 10 | superagent | 3.42K | 58.41 ms | 57.53 ms | 63.26 ms | 67.41 ms | 0 |
|
|
38
|
+
- **⚡ Zero-Overhead Hot Paths:** Fast header merging, response mapping, and object creation loops optimized for high-throughput environments. Object pooling for `InternalRequest` eliminates allocations in the hot path.
|
|
39
|
+
- **📍 LRU URL Caching:** Built-in string URL parsing cache (up to 512 entries) with automatic eviction to bypass repetitive `new URL()` overhead.
|
|
40
|
+
- **🔀 Intelligent Isomorphism:** Automatically switches between optimal underlying transports (Native Bun, Undici, or Node.js native `fetch`) while maintaining a unified, clean API.
|
|
41
|
+
- **🔌 Multi-Stage Hooks & Pipelines:** Granular control over the request lifecycle with sorted hook priorities and short-circuit capabilities.
|
|
42
|
+
- **🗜️ Transparent Decompression:** Automatic out-of-the-box handling of `gzip`, `deflate`, and `br` (Brotli) content-encodings for both standard `Uint8Array` buffers and `ReadableStream` data.
|
|
43
|
+
- **💎 Prototype Preservation:** Safe internal mapping that respects and carries forward custom prototypes passed via request configurations.
|
|
44
|
+
- **🦀 Rust-Powered Toolchain:** Built and linted with OXC (`oxlint` + `oxfmt`) for blazing-fast development cycles.
|
|
93
45
|
|
|
94
46
|
---
|
|
95
47
|
|
|
96
|
-
##
|
|
48
|
+
## 📦 Ecosystem Packages
|
|
97
49
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
|
|
|
104
|
-
|
|
|
105
|
-
| 🥈 2 | node-fetch | 22.91K | 8.69 ms | 8.79 ms | 12.34 ms | 13.28 ms | 0 |
|
|
106
|
-
| 🥉 3 | undici | 21.66K | 9.21 ms | 9.40 ms | 12.87 ms | 14.86 ms | 0 |
|
|
107
|
-
| 4 | @hyperttp/core | 13.73K | 14.53 ms | 14.42 ms | 15.74 ms | 22.15 ms | 0 |
|
|
108
|
-
| 5 | ky | 13.56K | 14.73 ms | 13.09 ms | 19.64 ms | 21.30 ms | 0 |
|
|
109
|
-
| 6 | hyperttp | 12.87K | 15.52 ms | 13.52 ms | 21.09 ms | 22.00 ms | 0 |
|
|
110
|
-
| 7 | request | 8.56K | 23.31 ms | 22.74 ms | 25.36 ms | 28.64 ms | 0 |
|
|
111
|
-
| 8 | superagent | 8.36K | 23.90 ms | 23.72 ms | 25.51 ms | 27.55 ms | 0 |
|
|
112
|
-
| 9 | axios | 6.35K | 31.41 ms | 31.53 ms | 33.56 ms | 38.03 ms | 0 |
|
|
113
|
-
| 10 | got | 5.28K | 37.84 ms | 30.25 ms | 56.91 ms | 59.92 ms | 0 |
|
|
50
|
+
| Package | Description | Repository |
|
|
51
|
+
| ---------------------------------------------------------------------------------------- | -------------------------------------------- | --------------------------------------------------------------- |
|
|
52
|
+
| **`@hyperttp/core`** (you are here) | Low-level core with transport pipeline | [GitHub](https://github.com/IT-IF-OR/hyperttp-core) |
|
|
53
|
+
| [`@hyperttp/types`](https://www.npmjs.com/package/@hyperttp/types) | Shared TypeScript type definitions | [GitHub](https://github.com/dirold2/hyperttp-types) |
|
|
54
|
+
| [`@hyperttp/transport-bun`](https://www.npmjs.com/package/@hyperttp/transport-bun) | Native Bun transport | [GitHub](https://github.com/IT-IF-OR/hyperttp-transport-bun) |
|
|
55
|
+
| [`@hyperttp/transport-undici`](https://www.npmjs.com/package/@hyperttp/transport-undici) | Undici transport for Node.js | [GitHub](https://github.com/IT-IF-OR/hyperttp-transport-undici) |
|
|
56
|
+
| [`hyperttp`](https://www.npmjs.com/package/hyperttp) | High-level client with all plugins pre-wired | [GitHub](https://github.com/dirold2/hyperttp) |
|
|
114
57
|
|
|
115
58
|
---
|
|
116
59
|
|
|
117
|
-
##
|
|
118
|
-
|
|
119
|
-
| Rank | Client | RPS | Avg | p50 | p90 | p99 | Errors |
|
|
120
|
-
| ---- | -------------- | ------ | -------- | -------- | -------- | -------- | ------ |
|
|
121
|
-
| 🥇 1 | undici | 15.92K | 12.53 ms | 12.38 ms | 12.88 ms | 16.75 ms | 0 |
|
|
122
|
-
| 🥈 2 | bun-fetch | 8.45K | 23.58 ms | 22.05 ms | 29.49 ms | 35.63 ms | 0 |
|
|
123
|
-
| 🥉 3 | @hyperttp/core | 7.47K | 26.70 ms | 25.03 ms | 32.76 ms | 41.48 ms | 0 |
|
|
124
|
-
| 4 | request | 7.42K | 26.91 ms | 26.06 ms | 30.98 ms | 35.71 ms | 0 |
|
|
125
|
-
| 5 | hyperttp | 6.84K | 29.16 ms | 27.72 ms | 34.39 ms | 43.95 ms | 0 |
|
|
126
|
-
| 6 | ky | 6.57K | 30.38 ms | 27.74 ms | 36.11 ms | 69.57 ms | 0 |
|
|
127
|
-
| 7 | axios | 4.80K | 41.57 ms | 40.46 ms | 45.35 ms | 56.94 ms | 0 |
|
|
128
|
-
| 8 | node-fetch | 4.59K | 43.43 ms | 41.54 ms | 48.93 ms | 63.88 ms | 0 |
|
|
129
|
-
| 9 | got | 4.44K | 44.96 ms | 43.24 ms | 49.36 ms | 65.20 ms | 0 |
|
|
130
|
-
| 10 | superagent | 3.39K | 58.86 ms | 57.93 ms | 64.18 ms | 69.88 ms | 0 |
|
|
60
|
+
## 🏗️ Architecture & Lifecycle
|
|
131
61
|
|
|
132
|
-
|
|
62
|
+
`HyperCore` shifts heavy lifting into structured execution pipelines:
|
|
133
63
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
64
|
+
```
|
|
65
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
66
|
+
│ HyperCore │
|
|
67
|
+
│ │
|
|
68
|
+
│ 1. Request Pipeline (onRequest) ─── short-circuit capable │
|
|
69
|
+
│ │ │
|
|
70
|
+
│ 2. Transport Execution (HyperTransport) │
|
|
71
|
+
│ ├─ BunTransport (native Bun fetch) │
|
|
72
|
+
│ ├─ UndiciTransport (Node.js) │
|
|
73
|
+
│ └─ NodeTransport (global fetch) │
|
|
74
|
+
│ │ │
|
|
75
|
+
│ 3. Response Data Pipeline (onResponseData) │
|
|
76
|
+
│ │ │
|
|
77
|
+
│ 4. Internal Processing (decompression, mapping) │
|
|
78
|
+
│ │ │
|
|
79
|
+
│ 5. Response Pipeline (onResponse) │
|
|
80
|
+
│ ├─ Mutators (sync/async modification) │
|
|
81
|
+
│ └─ Side Effects (background, non-blocking) │
|
|
82
|
+
│ │ │
|
|
83
|
+
│ 6. Error Pipeline (onError) ─── recovery capable │
|
|
84
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
85
|
+
```
|
|
148
86
|
|
|
149
87
|
---
|
|
150
88
|
|
|
@@ -155,9 +93,14 @@ npm install @hyperttp/transport-bun
|
|
|
155
93
|
```bash
|
|
156
94
|
npm install @hyperttp/core
|
|
157
95
|
|
|
96
|
+
# Optional: install a specific transport
|
|
97
|
+
npm install @hyperttp/transport-bun # for Bun
|
|
98
|
+
npm install @hyperttp/transport-undici # for Node.js
|
|
158
99
|
```
|
|
159
100
|
|
|
160
|
-
### Basic
|
|
101
|
+
### Basic Usage
|
|
102
|
+
|
|
103
|
+
`HyperCore` returns `HttpResponse<T>` objects with full control over the response body:
|
|
161
104
|
|
|
162
105
|
```typescript
|
|
163
106
|
import { HyperCore } from "@hyperttp/core";
|
|
@@ -169,10 +112,17 @@ const http = new HyperCore({
|
|
|
169
112
|
},
|
|
170
113
|
});
|
|
171
114
|
|
|
172
|
-
//
|
|
115
|
+
// Returns HttpResponse<T> with full control
|
|
173
116
|
const response = await http.get("https://api.example.com/data");
|
|
117
|
+
console.log(response.status);
|
|
118
|
+
console.log(response.headers);
|
|
119
|
+
|
|
120
|
+
// Built-in parsing methods
|
|
121
|
+
const json = await response.json<User>();
|
|
122
|
+
const text = await response.text();
|
|
123
|
+
const buffer = await response.arrayBuffer();
|
|
174
124
|
|
|
175
|
-
// Shortcut
|
|
125
|
+
// Shortcut methods
|
|
176
126
|
const userJson = await http.json<{ name: string }>("/users/123");
|
|
177
127
|
const logsText = await http.text("/logs/latest");
|
|
178
128
|
|
|
@@ -180,7 +130,7 @@ const logsText = await http.text("/logs/latest");
|
|
|
180
130
|
await http.dump("/analytics/ping");
|
|
181
131
|
```
|
|
182
132
|
|
|
183
|
-
###
|
|
133
|
+
### Streaming
|
|
184
134
|
|
|
185
135
|
```typescript
|
|
186
136
|
// GET Streams
|
|
@@ -196,18 +146,16 @@ const chatStream = await http.postStream("/v1/chat/completions", {
|
|
|
196
146
|
|
|
197
147
|
---
|
|
198
148
|
|
|
199
|
-
## 🔌
|
|
149
|
+
## 🔌 Plugin System
|
|
200
150
|
|
|
201
|
-
|
|
202
|
-
prioritized hooks.
|
|
151
|
+
Extend `HyperCore` with custom hooks that integrate into the pipeline:
|
|
203
152
|
|
|
204
153
|
```typescript
|
|
205
|
-
|
|
206
|
-
const authenticatedClient = http.extend({
|
|
207
|
-
network: { headers: { Authorization: "Bearer token_abc" } },
|
|
208
|
-
});
|
|
154
|
+
import { HyperCore } from "@hyperttp/core";
|
|
209
155
|
|
|
210
|
-
|
|
156
|
+
const http = new HyperCore();
|
|
157
|
+
|
|
158
|
+
http.use({
|
|
211
159
|
name: "performance-logger",
|
|
212
160
|
priority: 100, // Sorted execution priority (higher runs first)
|
|
213
161
|
mode: "background", // Forces onResponse to run as a non-blocking side-effect
|
|
@@ -222,22 +170,88 @@ authenticatedClient.use({
|
|
|
222
170
|
},
|
|
223
171
|
|
|
224
172
|
onResponse: async (res, req, ctx) => {
|
|
225
|
-
const duration = performance.now() - req.meta.startTime;
|
|
226
|
-
console.log(
|
|
227
|
-
`[${req.method}] ${req.url} -> ${res.status} (${duration.toFixed(2)}ms)`,
|
|
228
|
-
);
|
|
173
|
+
const duration = performance.now() - (req.meta.startTime as number);
|
|
174
|
+
console.log(`[${req.method}] ${req.url} -> ${res.status} (${duration.toFixed(2)}ms)`);
|
|
229
175
|
},
|
|
230
176
|
|
|
231
177
|
onError: async (error, req, ctx) => {
|
|
232
178
|
console.error(`Request failed to ${req.url}: ${error.message}`);
|
|
233
|
-
// Return a response object here
|
|
179
|
+
// Return a response object here to bypass/recover from the failure
|
|
234
180
|
},
|
|
235
181
|
});
|
|
236
182
|
```
|
|
237
183
|
|
|
184
|
+
### Plugin Phases
|
|
185
|
+
|
|
186
|
+
| Phase | Hook | Description |
|
|
187
|
+
| ----------- | ---------------- | ------------------------------------------------------- |
|
|
188
|
+
| **REQUEST** | `onRequest` | Intercepts before execution. Supports short-circuiting. |
|
|
189
|
+
| **DATA** | `onResponseData` | Transforms raw transport responses before mapping. |
|
|
190
|
+
| **FORMAT** | `onResponse` | Modifies client-facing responses. |
|
|
191
|
+
| **ERROR** | `onError` | Catches and recovers from errors. |
|
|
192
|
+
|
|
193
|
+
> 💡 **Need caching, rate limiting, queueing, parsing, and more?** Use the [`hyperttp`](https://www.npmjs.com/package/hyperttp) meta-package — it comes with 8 pre-wired plugins.
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 🌍 Transports
|
|
198
|
+
|
|
199
|
+
Hyperttp automatically selects the optimal transport for your runtime:
|
|
200
|
+
|
|
201
|
+
| Transport | Runtime | Installation |
|
|
202
|
+
| ------------------- | ----------------- | ---------------------------------------- |
|
|
203
|
+
| **BunTransport** | Bun | `npm install @hyperttp/transport-bun` |
|
|
204
|
+
| **UndiciTransport** | Node.js | `npm install @hyperttp/transport-undici` |
|
|
205
|
+
| **NodeTransport** | Node.js / Browser | Built-in (uses global `fetch`) |
|
|
206
|
+
|
|
207
|
+
### Custom Transport
|
|
208
|
+
|
|
209
|
+
Implement your own transport:
|
|
210
|
+
|
|
211
|
+
```typescript
|
|
212
|
+
import type { HyperTransport, TransportRequest, TransportResponse } from "@hyperttp/types";
|
|
213
|
+
|
|
214
|
+
class MyCustomTransport implements HyperTransport {
|
|
215
|
+
async execute(req: TransportRequest): Promise<TransportResponse> {
|
|
216
|
+
const response = await fetch(req.url, {
|
|
217
|
+
method: req.method,
|
|
218
|
+
headers: req.headers,
|
|
219
|
+
body: req.body,
|
|
220
|
+
signal: req.signal,
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
return {
|
|
224
|
+
status: response.status,
|
|
225
|
+
headers: Object.fromEntries(response.headers),
|
|
226
|
+
body: response.body,
|
|
227
|
+
url: response.url,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
async close(): Promise<void> {
|
|
232
|
+
// Cleanup resources
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const http = new HyperCore({}, new MyCustomTransport());
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## 🔄 Extending Configuration
|
|
242
|
+
|
|
243
|
+
Create derived clients with merged configuration via `.extend()`:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
// Inherit global pools and layers while changing specific presets
|
|
247
|
+
const authenticatedClient = http.extend({
|
|
248
|
+
network: { headers: { Authorization: "Bearer token_abc" } },
|
|
249
|
+
});
|
|
250
|
+
```
|
|
251
|
+
|
|
238
252
|
### Graceful Resource Destruction
|
|
239
253
|
|
|
240
|
-
Always clean up underlying transport configurations, socket pools, and keep
|
|
254
|
+
Always clean up underlying transport configurations, socket pools, and keep-alive timers in microservice tear-downs:
|
|
241
255
|
|
|
242
256
|
```typescript
|
|
243
257
|
// Performs a graceful or rapid shutdown sequence across transport selectors
|
|
@@ -246,6 +260,137 @@ await http.destroy(true);
|
|
|
246
260
|
|
|
247
261
|
---
|
|
248
262
|
|
|
263
|
+
## 📊 Benchmarks
|
|
264
|
+
|
|
265
|
+
### Test Configuration
|
|
266
|
+
|
|
267
|
+
```txt
|
|
268
|
+
Requests 20000
|
|
269
|
+
Concurrency 200
|
|
270
|
+
Duration 20000
|
|
271
|
+
Timeout 60000 ms
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
To run your own suite:
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
bun run bench.ts && npx tsx bench.ts
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## 🟦 Bun 1.3.14 — BunTransport
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
npm install @hyperttp/transport-bun
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
| Rank | Client | RPS | Avg | p50 | p90 | p99 | Errors |
|
|
287
|
+
| ---- | ------------------ | ---------- | ------------ | ------------ | ------------ | ------------ | ------ |
|
|
288
|
+
| 🥇 1 | bun-fetch | 24.34K | 8.18 ms | 8.50 ms | 10.62 ms | 14.10 ms | 0 |
|
|
289
|
+
| 🥈 2 | node-fetch | 21.58K | 9.23 ms | 9.39 ms | 12.86 ms | 14.72 ms | 0 |
|
|
290
|
+
| 🥉 3 | undici | 20.28K | 9.83 ms | 10.12 ms | 13.80 ms | 15.35 ms | 0 |
|
|
291
|
+
| 4 | **@hyperttp/core** | **17.39K** | **11.46 ms** | **12.94 ms** | **15.53 ms** | **16.66 ms** | 0 |
|
|
292
|
+
| 5 | ky | 12.80K | 15.58 ms | 13.95 ms | 20.62 ms | 22.77 ms | 0 |
|
|
293
|
+
| 6 | request | 8.31K | 24.00 ms | 23.43 ms | 29.54 ms | 32.82 ms | 0 |
|
|
294
|
+
| 7 | superagent | 7.96K | 25.09 ms | 24.95 ms | 26.85 ms | 28.46 ms | 0 |
|
|
295
|
+
| 8 | axios | 6.19K | 32.21 ms | 31.93 ms | 34.15 ms | 39.09 ms | 0 |
|
|
296
|
+
| 9 | got | 5.13K | 38.94 ms | 30.99 ms | 58.61 ms | 63.14 ms | 0 |
|
|
297
|
+
|
|
298
|
+
## 🟦 Bun 1.3.14 — NodeTransport
|
|
299
|
+
|
|
300
|
+
| Rank | Client | RPS | Avg | p50 | p90 | p99 | Errors |
|
|
301
|
+
| ---- | ------------------ | ---------- | ------------ | ------------ | ------------ | ------------ | ------ |
|
|
302
|
+
| 🥇 1 | bun-fetch | 23.94K | 8.32 ms | 8.63 ms | 10.64 ms | 13.77 ms | 0 |
|
|
303
|
+
| 🥈 2 | node-fetch | 21.71K | 9.18 ms | 9.35 ms | 12.58 ms | 14.40 ms | 0 |
|
|
304
|
+
| 🥉 3 | undici | 20.22K | 9.86 ms | 10.15 ms | 13.65 ms | 15.41 ms | 0 |
|
|
305
|
+
| 4 | **@hyperttp/core** | **17.80K** | **11.20 ms** | **12.38 ms** | **15.20 ms** | **17.29 ms** | 0 |
|
|
306
|
+
| 5 | ky | 12.78K | 15.63 ms | 13.92 ms | 20.59 ms | 23.70 ms | 0 |
|
|
307
|
+
| 6 | request | 8.20K | 24.31 ms | 23.62 ms | 29.13 ms | 34.53 ms | 0 |
|
|
308
|
+
| 7 | superagent | 8.06K | 24.79 ms | 24.79 ms | 27.26 ms | 29.52 ms | 0 |
|
|
309
|
+
| 8 | axios | 6.28K | 31.72 ms | 31.81 ms | 33.53 ms | 35.65 ms | 0 |
|
|
310
|
+
| 9 | got | 5.17K | 38.56 ms | 30.85 ms | 58.12 ms | 61.60 ms | 0 |
|
|
311
|
+
|
|
312
|
+
## 🟦 Node.js v24.14.1 — UndiciTransport
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
npm install @hyperttp/transport-undici
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
| Rank | Client | RPS | Avg | p50 | p90 | p99 | Errors |
|
|
319
|
+
| ---- | ------------------ | ---------- | ------------ | ------------ | ------------ | ------------ | ------ |
|
|
320
|
+
| 🥇 1 | undici | 13.84K | 14.41 ms | 13.54 ms | 15.39 ms | 26.23 ms | 0 |
|
|
321
|
+
| 🥈 2 | **@hyperttp/core** | **11.95K** | **16.68 ms** | **14.90 ms** | **17.04 ms** | **26.58 ms** | 0 |
|
|
322
|
+
| 3 | bun-fetch | 7.89K | 25.26 ms | 23.04 ms | 33.86 ms | 39.14 ms | 0 |
|
|
323
|
+
| 4 | request | 6.99K | 28.58 ms | 27.19 ms | 34.91 ms | 39.22 ms | 0 |
|
|
324
|
+
| 5 | ky | 5.97K | 33.42 ms | 30.05 ms | 41.58 ms | 64.01 ms | 0 |
|
|
325
|
+
| 6 | axios | 4.71K | 42.39 ms | 40.65 ms | 48.48 ms | 56.20 ms | 0 |
|
|
326
|
+
| 7 | node-fetch | 4.43K | 45.03 ms | 42.18 ms | 53.61 ms | 65.02 ms | 0 |
|
|
327
|
+
| 8 | got | 4.20K | 47.51 ms | 45.20 ms | 55.32 ms | 67.58 ms | 0 |
|
|
328
|
+
| 9 | superagent | 3.18K | 62.66 ms | 61.13 ms | 70.10 ms | 75.46 ms | 0 |
|
|
329
|
+
|
|
330
|
+
## 🟦 Node.js v24.14.1 — NodeTransport
|
|
331
|
+
|
|
332
|
+
| Rank | Client | RPS | Avg | p50 | p90 | p99 | Errors |
|
|
333
|
+
| ---- | ------------------ | --------- | ------------ | ------------ | ------------ | ------------ | ------ |
|
|
334
|
+
| 🥇 1 | undici | 15.45K | 12.91 ms | 12.68 ms | 13.69 ms | 16.96 ms | 0 |
|
|
335
|
+
| 🥈 2 | bun-fetch | 8.31K | 24.00 ms | 22.34 ms | 30.38 ms | 36.20 ms | 0 |
|
|
336
|
+
| 🥉 3 | request | 7.34K | 27.14 ms | 26.27 ms | 30.96 ms | 34.91 ms | 0 |
|
|
337
|
+
| 4 | **@hyperttp/core** | **7.23K** | **27.58 ms** | **25.68 ms** | **33.76 ms** | **42.75 ms** | 0 |
|
|
338
|
+
| 5 | ky | 6.41K | 31.14 ms | 28.43 ms | 37.55 ms | 61.30 ms | 0 |
|
|
339
|
+
| 6 | axios | 4.87K | 40.96 ms | 39.70 ms | 45.47 ms | 56.43 ms | 0 |
|
|
340
|
+
| 7 | node-fetch | 4.62K | 43.15 ms | 41.12 ms | 49.25 ms | 64.28 ms | 0 |
|
|
341
|
+
| 8 | got | 4.58K | 43.63 ms | 41.57 ms | 48.48 ms | 65.02 ms | 0 |
|
|
342
|
+
| 9 | superagent | 3.32K | 60.11 ms | 59.08 ms | 66.02 ms | 71.26 ms | 0 |
|
|
343
|
+
|
|
344
|
+
### 📈 Performance Analysis
|
|
345
|
+
|
|
346
|
+
**Key Insights:**
|
|
347
|
+
|
|
348
|
+
- **Bun + BunTransport**: @hyperttp/core achieves **17.39K RPS** — only 14% slower than native `bun-fetch` (24.34K)
|
|
349
|
+
- **Node.js + UndiciTransport**: @hyperttp/core reaches **11.95K RPS** with p99 latency of **26.58ms** — virtually identical to native undici (26.23ms)
|
|
350
|
+
- **Zero Error Rate**: 0% errors across all scenarios in all benchmarks
|
|
351
|
+
- **Memory Efficiency**: @hyperttp/core uses ~148-184MB in Bun, less than axios (201MB) and got (165-170MB)
|
|
352
|
+
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
## 🛠️ Development
|
|
356
|
+
|
|
357
|
+
This project uses the OXC toolchain for lightning-fast development:
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
# Install dependencies
|
|
361
|
+
bun install
|
|
362
|
+
|
|
363
|
+
# Type checking
|
|
364
|
+
bun run typecheck
|
|
365
|
+
|
|
366
|
+
# Linting (oxlint — ~8ms)
|
|
367
|
+
bun run lint
|
|
368
|
+
|
|
369
|
+
# Formatting (oxfmt — ~25ms)
|
|
370
|
+
bun run format
|
|
371
|
+
|
|
372
|
+
# Build
|
|
373
|
+
bun run build
|
|
374
|
+
|
|
375
|
+
# Run tests
|
|
376
|
+
bun run test
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
249
381
|
## 📄 License
|
|
250
382
|
|
|
251
383
|
MIT
|
|
384
|
+
|
|
385
|
+
---
|
|
386
|
+
|
|
387
|
+
## 🤝 Contributing
|
|
388
|
+
|
|
389
|
+
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
<p align="center">
|
|
394
|
+
Made with ❤️ by <a href="https://github.com/dirold2">dirold2</a>
|
|
395
|
+
</p>
|
|
396
|
+
```
|
package/package.json
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperttp/core",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "High-performance, extensible HTTP client for Node.js
|
|
3
|
+
"version": "1.4.1",
|
|
4
|
+
"description": "High-performance, extensible HTTP client for Node.js, Bun, Deno and Browser",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"sideEffects": false,
|
|
6
7
|
"main": "./index.js",
|
|
7
8
|
"types": "./index.d.ts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
11
|
"types": "./index.d.ts",
|
|
11
|
-
"import": "./index.js"
|
|
12
|
-
|
|
13
|
-
},
|
|
14
|
-
"./package.json": "./package.json"
|
|
12
|
+
"import": "./index.js"
|
|
13
|
+
}
|
|
15
14
|
},
|
|
16
15
|
"keywords": [
|
|
17
16
|
"http",
|
|
@@ -19,7 +18,10 @@
|
|
|
19
18
|
"high-performance",
|
|
20
19
|
"undici",
|
|
21
20
|
"fetch",
|
|
22
|
-
"bun"
|
|
21
|
+
"bun",
|
|
22
|
+
"deno",
|
|
23
|
+
"isomorphic",
|
|
24
|
+
"hyperttp"
|
|
23
25
|
],
|
|
24
26
|
"author": "dirold2",
|
|
25
27
|
"license": "MIT",
|
|
@@ -28,10 +30,14 @@
|
|
|
28
30
|
"url": "git+https://github.com/IT-IF-OR/hyperttp-core.git"
|
|
29
31
|
},
|
|
30
32
|
"peerDependencies": {
|
|
31
|
-
"@hyperttp/
|
|
33
|
+
"@hyperttp/types": "^0.2.1",
|
|
34
|
+
"@hyperttp/transport-bun": "^0.2.2",
|
|
32
35
|
"@hyperttp/transport-undici": "^0.2.0"
|
|
33
36
|
},
|
|
34
37
|
"peerDependenciesMeta": {
|
|
38
|
+
"@hyperttp/types": {
|
|
39
|
+
"optional": false
|
|
40
|
+
},
|
|
35
41
|
"@hyperttp/transport-bun": {
|
|
36
42
|
"optional": true
|
|
37
43
|
},
|