recker
v1.0.26
Published
AI & DevX focused HTTP client for Node.js 18+
Downloads
7,604
Maintainers
Readme
⚡ Recker
The Network SDK for the AI Era
Zero-config HTTP. Multi-protocol support. AI-native streaming. Observable to the millisecond.
Documentation · API Reference · Examples
Install
npm install reckerQuick Start
import { get, post, whois, dns } from 'recker';
import { rdap, supportsRDAP } from 'recker/utils/rdap';
// HTTP - zero config
const users = await get('https://api.example.com/users').json();
await post('https://api.example.com/users', { json: { name: 'John' } });
// WHOIS
const info = await whois('github.com');
// RDAP (modern WHOIS)
if (supportsRDAP('com')) {
const data = await rdap(client, 'google.com');
console.log(data.status, data.events);
}
// DNS
const ips = await dns('google.com');Unified Namespace
import { recker } from 'recker';
// Everything in one place
await recker.get('https://api.example.com/users').json();
await recker.whois('github.com');
await recker.dns('google.com');
await recker.ai.chat('Hello!');
const socket = recker.ws('wss://api.example.com/ws');With Configuration
import { createClient } from 'recker';
const api = createClient({
baseUrl: 'https://api.example.com',
headers: { 'Authorization': 'Bearer token' },
timeout: 10000,
retry: { maxAttempts: 3 }
});
const user = await api.get('/users/:id', { params: { id: '123' } }).json();Mini Client (Maximum Performance)
Need raw speed? Use recker-mini for ~2% overhead vs raw undici:
import { createMiniClient, miniGet } from 'recker/mini';
// Client instance
const fast = createMiniClient({ baseUrl: 'https://api.example.com' });
const data = await fast.get('/users').then(r => r.json());
// Or direct function (even faster)
const users = await miniGet('https://api.example.com/users').then(r => r.json());| Mode | Speed | Features |
|------|-------|----------|
| recker-mini | ~146µs (2% overhead) | Base URL, headers, JSON |
| recker | ~265µs (86% overhead) | Retry, cache, auth, hooks, plugins |
See Mini Client documentation for more.
Features
| Feature | Description | |:---|:---| | Zero Config | Direct functions work out of the box. No setup required. | | Multi-Protocol | HTTP, WebSocket, DNS, WHOIS, RDAP, FTP, SFTP, Telnet in one SDK. | | AI-Native | SSE streaming, token counting, provider abstraction. | | Type-Safe | Full TypeScript with Zod schema validation. | | Observable | DNS/TCP/TLS/TTFB timing breakdown per request. | | Resilient | Retry, circuit breaker, rate limiting, deduplication. | | GeoIP (Offline) | MaxMind GeoLite2 database with bogon detection. | | RDAP Support | Modern WHOIS with IANA Bootstrap and TLD detection. |
Highlights
AI Streaming
for await (const event of recker.ai.stream({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Hello!' }]
})) {
process.stdout.write(event.choices[0]?.delta?.content || '');
}Request Timing
const response = await get('https://api.example.com/data');
console.log(response.timings);
// { dns: 12, tcp: 8, tls: 45, firstByte: 23, total: 156 }Scraping
const doc = await client.scrape('https://example.com');
const titles = doc.selectAll('h1').map(el => el.text());Circuit Breaker
import { createClient, circuitBreaker } from 'recker';
const client = createClient({
baseUrl: 'https://api.example.com',
plugins: [
circuitBreaker({ threshold: 5, resetTimeout: 30000 })
]
});CLI (rek)
A powerful terminal client that replaces curl:
# Install globally
npm install -g recker
# Simple requests
rek httpbin.org/json
rek POST api.com/users name="John" age:=30
# Pipe to bash (like curl)
rek -q https://get.docker.com | bash
# Save to file
rek -o data.json api.com/export
# Interactive shell
rek shell
# Mock servers for testing
rek serve http # HTTP on :3000
rek serve ws # WebSocket on :8080
rek serve hls # HLS streaming on :8082See CLI Documentation for more.
Documentation
- Quick Start - Get running in 2 minutes
- Mini Client - Maximum performance mode
- CLI Guide - Terminal client documentation
- API Reference - Complete API documentation
- Configuration - Client options
- Plugins - Extend functionality
- AI Integration - OpenAI, Anthropic, and more
- Protocols - WebSocket, DNS, WHOIS
- Mock Servers - Built-in test servers
- Benchmarks - Performance comparisons
License
MIT © Forattini
