recker 1.0.21-next.cd9a658 → 1.0.21-next.d9fe496

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/README.md CHANGED
@@ -77,6 +77,28 @@ const api = createClient({
77
77
  const user = await api.get('/users/:id', { params: { id: '123' } }).json();
78
78
  ```
79
79
 
80
+ ### Mini Client (Maximum Performance)
81
+
82
+ Need raw speed? Use `recker-mini` for ~2% overhead vs raw undici:
83
+
84
+ ```typescript
85
+ import { createMiniClient, miniGet } from 'recker/mini';
86
+
87
+ // Client instance
88
+ const fast = createMiniClient({ baseUrl: 'https://api.example.com' });
89
+ const data = await fast.get('/users').then(r => r.json());
90
+
91
+ // Or direct function (even faster)
92
+ const users = await miniGet('https://api.example.com/users').then(r => r.json());
93
+ ```
94
+
95
+ | Mode | Speed | Features |
96
+ |------|-------|----------|
97
+ | `recker-mini` | ~146µs (2% overhead) | Base URL, headers, JSON |
98
+ | `recker` | ~265µs (86% overhead) | Retry, cache, auth, hooks, plugins |
99
+
100
+ See [Mini Client documentation](./docs/http/18-mini-client.md) for more.
101
+
80
102
  ## Features
81
103
 
82
104
  | Feature | Description |
@@ -163,6 +185,7 @@ See [CLI Documentation](./docs/cli/01-overview.md) for more.
163
185
  ## Documentation
164
186
 
165
187
  - **[Quick Start](./docs/http/01-quickstart.md)** - Get running in 2 minutes
188
+ - **[Mini Client](./docs/http/18-mini-client.md)** - Maximum performance mode
166
189
  - **[CLI Guide](./docs/cli/01-overview.md)** - Terminal client documentation
167
190
  - **[API Reference](./docs/reference/01-api.md)** - Complete API documentation
168
191
  - **[Configuration](./docs/http/05-configuration.md)** - Client options
@@ -170,6 +193,7 @@ See [CLI Documentation](./docs/cli/01-overview.md) for more.
170
193
  - **[AI Integration](./docs/ai/01-overview.md)** - OpenAI, Anthropic, and more
171
194
  - **[Protocols](./docs/protocols/01-websocket.md)** - WebSocket, DNS, WHOIS
172
195
  - **[Mock Servers](./docs/cli/08-mock-servers.md)** - Built-in test servers
196
+ - **[Benchmarks](./docs/benchmarks.md)** - Performance comparisons
173
197
 
174
198
  ## License
175
199
 
package/dist/index.d.ts CHANGED
@@ -65,7 +65,7 @@ export * as testing from './testing/index.js';
65
65
  export * as protocols from './protocols/index.js';
66
66
  export * from './mcp/client.js';
67
67
  export * from './mcp/contract.js';
68
- export * from './bare.js';
68
+ export * from './mini.js';
69
69
  export { Client as Recker } from './core/client.js';
70
70
  export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
71
71
  export { default } from './recker.js';
package/dist/index.js CHANGED
@@ -65,7 +65,7 @@ export * as testing from './testing/index.js';
65
65
  export * as protocols from './protocols/index.js';
66
66
  export * from './mcp/client.js';
67
67
  export * from './mcp/contract.js';
68
- export * from './bare.js';
68
+ export * from './mini.js';
69
69
  export { Client as Recker } from './core/client.js';
70
70
  export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
71
71
  export { default } from './recker.js';
package/dist/mini.d.ts ADDED
@@ -0,0 +1,28 @@
1
+ export interface MiniClientOptions {
2
+ baseUrl: string;
3
+ headers?: Record<string, string>;
4
+ }
5
+ export interface MiniResponse<T = unknown> {
6
+ status: number;
7
+ headers: Headers;
8
+ json(): Promise<T>;
9
+ text(): Promise<string>;
10
+ arrayBuffer(): Promise<ArrayBuffer>;
11
+ blob(): Promise<Blob>;
12
+ }
13
+ export interface MiniClient {
14
+ get<T = unknown>(path: string): Promise<MiniResponse<T>>;
15
+ post<T = unknown>(path: string, body?: unknown): Promise<MiniResponse<T>>;
16
+ put<T = unknown>(path: string, body?: unknown): Promise<MiniResponse<T>>;
17
+ patch<T = unknown>(path: string, body?: unknown): Promise<MiniResponse<T>>;
18
+ delete<T = unknown>(path: string): Promise<MiniResponse<T>>;
19
+ }
20
+ export declare function createMiniClient(options: MiniClientOptions): MiniClient;
21
+ export declare function miniGet<T = unknown>(url: string, headers?: Record<string, string>): Promise<MiniResponse<T>>;
22
+ export declare function miniPost<T = unknown>(url: string, data?: unknown, headers?: Record<string, string>): Promise<MiniResponse<T>>;
23
+ export declare const createBareClient: typeof createMiniClient;
24
+ export type BareClientOptions = MiniClientOptions;
25
+ export type BareResponse<T = unknown> = MiniResponse<T>;
26
+ export type BareClient = MiniClient;
27
+ export declare const bareGet: typeof miniGet;
28
+ export declare const barePost: typeof miniPost;
@@ -1,5 +1,5 @@
1
1
  import { request as undiciRequest } from 'undici';
2
- export function createBareClient(options) {
2
+ export function createMiniClient(options) {
3
3
  const base = options.baseUrl.endsWith('/')
4
4
  ? options.baseUrl.slice(0, -1)
5
5
  : options.baseUrl;
@@ -57,7 +57,7 @@ export function createBareClient(options) {
57
57
  }
58
58
  };
59
59
  }
60
- export async function bareGet(url, headers) {
60
+ export async function miniGet(url, headers) {
61
61
  const { statusCode, headers: resHeaders, body } = await undiciRequest(url, {
62
62
  method: 'GET',
63
63
  headers
@@ -71,7 +71,7 @@ export async function bareGet(url, headers) {
71
71
  blob: async () => new Blob([await body.arrayBuffer()])
72
72
  };
73
73
  }
74
- export async function barePost(url, data, headers) {
74
+ export async function miniPost(url, data, headers) {
75
75
  const { statusCode, headers: resHeaders, body } = await undiciRequest(url, {
76
76
  method: 'POST',
77
77
  headers: {
@@ -89,3 +89,6 @@ export async function barePost(url, data, headers) {
89
89
  blob: async () => new Blob([await body.arrayBuffer()])
90
90
  };
91
91
  }
92
+ export const createBareClient = createMiniClient;
93
+ export const bareGet = miniGet;
94
+ export const barePost = miniPost;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recker",
3
- "version": "1.0.21-next.cd9a658",
3
+ "version": "1.0.21-next.d9fe496",
4
4
  "description": "AI & DevX focused HTTP client for Node.js 18+",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -106,9 +106,13 @@
106
106
  "types": "./dist/ai/index.d.ts",
107
107
  "import": "./dist/ai/index.js"
108
108
  },
109
+ "./mini": {
110
+ "types": "./dist/mini.d.ts",
111
+ "import": "./dist/mini.js"
112
+ },
109
113
  "./bare": {
110
- "types": "./dist/bare.d.ts",
111
- "import": "./dist/bare.js"
114
+ "types": "./dist/mini.d.ts",
115
+ "import": "./dist/mini.js"
112
116
  },
113
117
  "./package.json": "./package.json"
114
118
  },
package/dist/bare.d.ts DELETED
@@ -1,22 +0,0 @@
1
- export interface BareClientOptions {
2
- baseUrl: string;
3
- headers?: Record<string, string>;
4
- }
5
- export interface BareResponse<T = unknown> {
6
- status: number;
7
- headers: Headers;
8
- json(): Promise<T>;
9
- text(): Promise<string>;
10
- arrayBuffer(): Promise<ArrayBuffer>;
11
- blob(): Promise<Blob>;
12
- }
13
- export interface BareClient {
14
- get<T = unknown>(path: string): Promise<BareResponse<T>>;
15
- post<T = unknown>(path: string, body?: unknown): Promise<BareResponse<T>>;
16
- put<T = unknown>(path: string, body?: unknown): Promise<BareResponse<T>>;
17
- patch<T = unknown>(path: string, body?: unknown): Promise<BareResponse<T>>;
18
- delete<T = unknown>(path: string): Promise<BareResponse<T>>;
19
- }
20
- export declare function createBareClient(options: BareClientOptions): BareClient;
21
- export declare function bareGet<T = unknown>(url: string, headers?: Record<string, string>): Promise<BareResponse<T>>;
22
- export declare function barePost<T = unknown>(url: string, data?: unknown, headers?: Record<string, string>): Promise<BareResponse<T>>;