recker 1.0.15-next.3794a15 → 1.0.15

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
@@ -2,135 +2,155 @@
2
2
 
3
3
  # ⚡ Recker
4
4
 
5
- ### The Network SDK for the AI Era
5
+ ### The HTTP SDK for the AI Era
6
6
 
7
- **Zero-config HTTP. Multi-protocol support. AI-native streaming. Observable to the millisecond.**
7
+ **Fast as infrastructure demands. AI-ready from the first byte. Observable down to the millisecond. Resilient when everything else fails.**
8
8
 
9
9
  [![npm version](https://img.shields.io/npm/v/recker.svg?style=flat-square&color=F5A623)](https://www.npmjs.com/package/recker)
10
10
  [![npm downloads](https://img.shields.io/npm/dm/recker.svg?style=flat-square&color=34C759)](https://www.npmjs.com/package/recker)
11
11
  [![TypeScript](https://img.shields.io/badge/TypeScript-5.0+-3178C6?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
12
12
  [![Node.js](https://img.shields.io/badge/Node.js-18+-339933?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org/)
13
- [![Coverage](https://img.shields.io/badge/coverage-90%25-34C759?style=flat-square)](https://github.com/forattini-dev/recker)
13
+ [![Coverage](https://img.shields.io/badge/coverage-85%25-F5A623?style=flat-square)](https://github.com/forattini-dev/recker)
14
14
  [![License](https://img.shields.io/npm/l/recker.svg?style=flat-square&color=007AFF)](https://github.com/forattini-dev/recker/blob/main/LICENSE)
15
15
 
16
- [Documentation](https://forattini-dev.github.io/recker) · [API Reference](./docs/reference/01-api.md) · [Examples](./docs/examples/README.md)
16
+ [Documentation](https://forattini-dev.github.io/recker) · [Examples](./docs/examples/README.md) · [Migration](./docs/migration.md)
17
17
 
18
18
  </div>
19
19
 
20
20
  ---
21
21
 
22
- ## Install
22
+ ## 📦 Install
23
23
 
24
24
  ```bash
25
25
  npm install recker
26
26
  ```
27
27
 
28
- ## Quick Start
28
+ ## 🚀 Quick Start
29
29
 
30
30
  ```typescript
31
- import { get, post, whois, dns } from 'recker';
32
-
33
- // HTTP - zero config
34
- const users = await get('https://api.example.com/users').json();
35
- await post('https://api.example.com/users', { json: { name: 'John' } });
36
-
37
- // WHOIS
38
- const info = await whois('github.com');
39
-
40
- // DNS
41
- const ips = await dns('google.com');
42
- ```
31
+ import { createClient } from 'recker';
43
32
 
44
- ### Unified Namespace
33
+ const client = createClient({ baseUrl: 'https://api.example.com' });
45
34
 
46
- ```typescript
47
- import { recker } from 'recker';
35
+ // GET with JSON
36
+ const users = await client.get('/users').json();
48
37
 
49
- // Everything in one place
50
- await recker.get('https://api.example.com/users').json();
51
- await recker.whois('github.com');
52
- await recker.dns('google.com');
53
- await recker.ai.chat('Hello!');
38
+ // POST with body
39
+ await client.post('/users', { json: { name: 'John' } });
54
40
 
55
- const socket = recker.ws('wss://api.example.com/ws');
41
+ // Path params + query
42
+ await client.get('/users/:id', { params: { id: '123', expand: 'profile' } });
56
43
  ```
57
44
 
58
- ### With Configuration
45
+ ## Why Recker?
59
46
 
60
- ```typescript
61
- import { createClient } from 'recker';
62
-
63
- const api = createClient({
64
- baseUrl: 'https://api.example.com',
65
- headers: { 'Authorization': 'Bearer token' },
66
- timeout: 10000,
67
- retry: { maxAttempts: 3 }
68
- });
69
-
70
- const user = await api.get('/users/:id', { params: { id: '123' } }).json();
71
- ```
72
-
73
- ## Features
47
+ Recker isn't just another HTTP client. It's a **complete orchestration layer** designed for modern, data-intensive applications.
74
48
 
75
49
  | Feature | Description |
76
50
  |:---|:---|
77
- | **Zero Config** | Direct functions work out of the box. No setup required. |
78
- | **Multi-Protocol** | HTTP, WebSocket, DNS, WHOIS, FTP, SFTP, Telnet in one SDK. |
79
- | **AI-Native** | SSE streaming, token counting, provider abstraction. |
80
- | **Type-Safe** | Full TypeScript with Zod schema validation. |
81
- | **Observable** | DNS/TCP/TLS/TTFB timing breakdown per request. |
82
- | **Resilient** | Retry, circuit breaker, rate limiting, deduplication. |
51
+ | 🔮 **19 HTTP Methods** | Beyond CRUD: WebDAV, CDN Purging, and specialized verbs. |
52
+ | 🤖 **AI-First** | Native Server-Sent Events (SSE) parsing optimized for LLMs. |
53
+ | 🕷️ **Scraping Ready** | jQuery-like HTML parsing, HLS downloading, and proxy rotation. |
54
+ | 🛡️ **Security Suite** | Built-in SSL inspection, WHOIS/RDAP, and DNS analysis. |
55
+ | **Performance** | Connection pooling, deduplication, and deep network metrics. |
56
+ | 🛡️ **Resilience** | Circuit breakers, smart retries, and rate limit awareness. |
83
57
 
84
- ## Highlights
58
+ ## 💡 Feature Highlights
85
59
 
86
- ### AI Streaming
60
+ ### Stream AI Responses
61
+ Handle LLM streams effortlessly with the `.sse()` iterator.
87
62
 
88
63
  ```typescript
89
- for await (const event of recker.ai.stream({
90
- model: 'gpt-4',
91
- messages: [{ role: 'user', content: 'Hello!' }]
92
- })) {
93
- process.stdout.write(event.choices[0]?.delta?.content || '');
64
+ for await (const event of client.post('/v1/chat/completions', {
65
+ json: { model: 'gpt-5', messages, stream: true }
66
+ }).sse()) {
67
+ process.stdout.write(event.data);
94
68
  }
95
69
  ```
96
70
 
97
- ### Request Timing
98
-
99
- ```typescript
100
- const response = await get('https://api.example.com/data');
101
- console.log(response.timings);
102
- // { dns: 12, tcp: 8, tls: 45, firstByte: 23, total: 156 }
103
- ```
104
-
105
- ### Scraping
71
+ ### Scrape & Extract
72
+ Turn any webpage into structured data with the `.scrape()` method.
106
73
 
107
74
  ```typescript
108
75
  const doc = await client.scrape('https://example.com');
109
76
  const titles = doc.selectAll('h1').map(el => el.text());
110
77
  ```
111
78
 
112
- ### Circuit Breaker
79
+ ### Reliability Built-in
80
+ Configure advanced retry policies in declarative style.
113
81
 
114
82
  ```typescript
115
- import { createClient, circuitBreaker } from 'recker';
116
-
117
83
  const client = createClient({
118
- baseUrl: 'https://api.example.com',
119
84
  plugins: [
120
- circuitBreaker({ threshold: 5, resetTimeout: 30000 })
85
+ retry({ maxAttempts: 3, backoff: 'exponential', jitter: true })
121
86
  ]
122
87
  });
123
88
  ```
124
89
 
125
- ## Documentation
90
+ ### Deep Observability
91
+ Know exactly where your latency comes from.
92
+
93
+ ```typescript
94
+ const { timings } = await client.get('/api/data');
95
+ console.log(timings);
96
+ // { dns: 12ms, tcp: 8ms, tls: 45ms, firstByte: 23ms, total: 156ms }
97
+ ```
98
+
99
+ ## 📚 Documentation
100
+
101
+ **Getting Started**
102
+ - [Installation](./docs/getting-started/installation.md)
103
+ - [Quick Start](./docs/http/01-quickstart.md)
104
+ - [Client Configuration](./docs/http/05-configuration.md)
105
+
106
+ **Core Features**
107
+ - [HTTP Fundamentals](./docs/http/02-fundamentals.md)
108
+ - [Streaming & SSE](./docs/ai/02-streaming.md)
109
+ - [Retry & Resilience](./docs/http/07-resilience.md)
110
+ - [Caching](./docs/http/09-cache.md)
111
+ - [Concurrency](./docs/http/08-concurrency.md)
112
+
113
+ **Integrations**
114
+ - [GraphQL](./docs/http/13-graphql.md)
115
+ - [Scraping](./docs/http/14-scraping.md)
116
+ - [Plugins](./docs/http/10-plugins.md)
117
+
118
+ **Reference**
119
+ - [API Reference](./docs/reference/01-api.md)
120
+ - [Troubleshooting](./docs/reference/05-troubleshooting.md)
121
+ - [Examples](./docs/examples/README.md)
122
+
123
+ ## ❤️ Acknowledgements
126
124
 
127
- - **[Quick Start](./docs/http/01-quickstart.md)** - Get running in 2 minutes
128
- - **[API Reference](./docs/reference/01-api.md)** - Complete API documentation
129
- - **[Configuration](./docs/http/05-configuration.md)** - Client options
130
- - **[Plugins](./docs/http/10-plugins.md)** - Extend functionality
131
- - **[AI Integration](./docs/ai/01-overview.md)** - OpenAI, Anthropic, and more
132
- - **[Protocols](./docs/protocols/01-websocket.md)** - WebSocket, DNS, WHOIS
125
+ At Recker, we are passionate about these incredible open-source technologies. We are here to celebrate the past achievements that shaped the internet as we know it today, and to prepare ourselves for the future of web development.
133
126
 
134
- ## License
127
+ Recker stands on the shoulders of giants. We extend our deepest gratitude to these projects:
128
+
129
+ <div align="center">
130
+
131
+ | | | |
132
+ |:---|:---|:---|
133
+ | **[Apollo Client](https://github.com/apollographql/apollo-client)** | **[Axios](https://github.com/axios/axios)** | **[Cheerio](https://github.com/cheeriojs/cheerio)** |
134
+ | **[Cookie](https://github.com/jshttp/cookie)** | **[Got](https://github.com/sindresorhus/got)** | **[GraphQL.js](https://github.com/graphql/graphql-js)** |
135
+ | **[Ky](https://github.com/sindresorhus/ky)** | **[Needle](https://github.com/tomas/needle)** | **[Node-libcurl](https://github.com/JCMais/node-libcurl)** |
136
+ | **[SuperAgent](https://github.com/ladjs/superagent)** | **[Undici](https://github.com/nodejs/undici)** | **[WS](https://github.com/websockets/ws)** |
137
+
138
+ </div>
139
+
140
+ ## 🤝 Contributing
141
+
142
+ We welcome contributions! See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
143
+
144
+ ## 📄 License
135
145
 
136
146
  MIT © [Forattini](https://github.com/forattini-dev)
147
+
148
+ ---
149
+
150
+ <div align="center">
151
+
152
+ **Built for the AI era.**
153
+
154
+ [Documentation](https://forattini-dev.github.io/recker) · [GitHub](https://github.com/forattini-dev/recker) · [npm](https://www.npmjs.com/package/recker)
155
+
156
+ </div>
package/dist/index.d.ts CHANGED
@@ -64,6 +64,4 @@ export * as protocols from './protocols/index.js';
64
64
  export * from './mcp/client.js';
65
65
  export * from './mcp/contract.js';
66
66
  export { Client as Recker } from './core/client.js';
67
- export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
68
- export { default } from './recker.js';
69
67
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAA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AAC;AAC9C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAGlD,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -64,5 +64,3 @@ export * as protocols from './protocols/index.js';
64
64
  export * from './mcp/client.js';
65
65
  export * from './mcp/contract.js';
66
66
  export { Client as Recker } from './core/client.js';
67
- export { get, post, put, patch, del, del as delete, head, options, whois, whoisAvailable, dns, dnsSecurity, ws, recker, } from './recker.js';
68
- export { default } from './recker.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recker",
3
- "version": "1.0.15-next.3794a15",
3
+ "version": "1.0.15",
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",
package/dist/recker.d.ts DELETED
@@ -1,47 +0,0 @@
1
- import { Client, type ExtendedClientOptions } from './core/client.js';
2
- import { type RequestPromise } from './core/request-promise.js';
3
- import type { RequestOptions } from './types/index.js';
4
- import { type WebSocketOptions, type ReckerWebSocket } from './websocket/client.js';
5
- import { createWhois, type WhoisResult, type WhoisOptions } from './utils/whois.js';
6
- import { type DNSClientOptions, type DNSClient } from './dns/index.js';
7
- import type { AIClientConfig } from './types/ai.js';
8
- export declare function get(url: string, options?: RequestOptions): RequestPromise;
9
- export declare function post(url: string, options?: RequestOptions): RequestPromise;
10
- export declare function put(url: string, options?: RequestOptions): RequestPromise;
11
- export declare function patch(url: string, options?: RequestOptions): RequestPromise;
12
- export declare function del(url: string, options?: RequestOptions): RequestPromise;
13
- export declare function head(url: string, options?: RequestOptions): RequestPromise;
14
- export declare function options(url: string, options?: RequestOptions): RequestPromise;
15
- export declare function whois(query: string, options?: WhoisOptions): Promise<WhoisResult>;
16
- export declare function whoisAvailable(domain: string): Promise<boolean>;
17
- export declare function dns(hostname: string, type?: 'A' | 'AAAA' | 'MX' | 'TXT' | 'NS' | 'CNAME'): Promise<string[]>;
18
- export declare function dnsSecurity(domain: string): Promise<import("./utils/dns-toolkit.js").DnsSecurityRecords>;
19
- export declare function ws(url: string, options?: WebSocketOptions): ReckerWebSocket;
20
- export declare const recker: {
21
- get: typeof get;
22
- post: typeof post;
23
- put: typeof put;
24
- patch: typeof patch;
25
- delete: typeof del;
26
- head: typeof head;
27
- options: typeof options;
28
- whois: typeof whois;
29
- whoisAvailable: typeof whoisAvailable;
30
- dns: typeof dns;
31
- dnsSecurity: typeof dnsSecurity;
32
- ws: typeof ws;
33
- ai: {
34
- chat: (optionsOrPrompt: string | import("./types/ai.js").ChatOptions) => Promise<import("./types/ai.js").AIResponse<string>>;
35
- stream: (options: import("./types/ai.js").ChatOptions) => Promise<import("./types/ai.js").AIStream>;
36
- embed: (options: import("./types/ai.js").EmbedOptions) => Promise<import("./types/ai.js").EmbedResponse>;
37
- extend: (defaults: Partial<import("./types/ai.js").ChatOptions>) => import("./types/ai.js").AIClient;
38
- readonly metrics: import("./types/ai.js").AIMetrics;
39
- };
40
- client: (options?: ExtendedClientOptions) => Client;
41
- dnsClient: (options?: DNSClientOptions) => DNSClient;
42
- whoisClient: typeof createWhois;
43
- aiClient: (options?: AIClientConfig) => import("./types/ai.js").AIClient;
44
- reset: () => void;
45
- };
46
- export default recker;
47
- //# sourceMappingURL=recker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recker.d.ts","sourceRoot":"","sources":["../src/recker.ts"],"names":[],"mappings":"AAwCA,OAAO,EAAE,MAAM,EAAgB,KAAK,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAmB,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACrG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,CAEvH;AAMD,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,gEAE/C;AAMD,wBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,eAAe,CAE3E;AA8DD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;uBAgDE,qBAAqB;0BAKlB,gBAAgB;;yBAUjB,cAAc;;CAUpC,CAAC;AAGF,eAAe,MAAM,CAAC"}
package/dist/recker.js DELETED
@@ -1,99 +0,0 @@
1
- import { createClient } from './core/client.js';
2
- import { FetchTransport } from './transport/fetch.js';
3
- import { createWebSocket } from './websocket/client.js';
4
- import { whois as whoisLookup, isDomainAvailable, createWhois } from './utils/whois.js';
5
- import { createDNS } from './dns/index.js';
6
- import { createAI } from './ai/index.js';
7
- let _defaultClient = null;
8
- let _defaultDns = null;
9
- let _defaultAi = null;
10
- function getDefaultClient() {
11
- if (!_defaultClient) {
12
- _defaultClient = createClient({
13
- transport: new FetchTransport(),
14
- });
15
- }
16
- return _defaultClient;
17
- }
18
- function getDefaultDns() {
19
- if (!_defaultDns) {
20
- _defaultDns = createDNS();
21
- }
22
- return _defaultDns;
23
- }
24
- function getDefaultAi() {
25
- if (!_defaultAi) {
26
- _defaultAi = createAI();
27
- }
28
- return _defaultAi;
29
- }
30
- export function get(url, options) {
31
- return getDefaultClient().get(url, options);
32
- }
33
- export function post(url, options) {
34
- return getDefaultClient().post(url, options);
35
- }
36
- export function put(url, options) {
37
- return getDefaultClient().put(url, options);
38
- }
39
- export function patch(url, options) {
40
- return getDefaultClient().patch(url, options);
41
- }
42
- export function del(url, options) {
43
- return getDefaultClient().delete(url, options);
44
- }
45
- export function head(url, options) {
46
- return getDefaultClient().head(url, options);
47
- }
48
- export function options(url, options) {
49
- return getDefaultClient().options(url, options);
50
- }
51
- export async function whois(query, options) {
52
- return whoisLookup(query, options);
53
- }
54
- export async function whoisAvailable(domain) {
55
- return isDomainAvailable(domain);
56
- }
57
- export async function dns(hostname, type = 'A') {
58
- return getDefaultDns().resolve(hostname, type);
59
- }
60
- export async function dnsSecurity(domain) {
61
- return getDefaultDns().getSecurityRecords(domain);
62
- }
63
- export function ws(url, options) {
64
- return createWebSocket(url, options);
65
- }
66
- const aiNamespace = {
67
- chat: (...args) => getDefaultAi().chat(...args),
68
- stream: (...args) => getDefaultAi().stream(...args),
69
- embed: (...args) => getDefaultAi().embed(...args),
70
- extend: (...args) => getDefaultAi().extend(...args),
71
- get metrics() {
72
- return getDefaultAi().metrics;
73
- },
74
- };
75
- export const recker = {
76
- get,
77
- post,
78
- put,
79
- patch,
80
- delete: del,
81
- head,
82
- options,
83
- whois,
84
- whoisAvailable,
85
- dns,
86
- dnsSecurity,
87
- ws,
88
- ai: aiNamespace,
89
- client: (options) => createClient(options),
90
- dnsClient: (options) => createDNS(options),
91
- whoisClient: createWhois,
92
- aiClient: (options) => createAI(options),
93
- reset: () => {
94
- _defaultClient = null;
95
- _defaultDns = null;
96
- _defaultAi = null;
97
- },
98
- };
99
- export default recker;