rezo
v1.0.135
Published
Lightning-fast, enterprise-grade HTTP client for modern JavaScript. Full HTTP/2 support, intelligent cookie management, multiple adapters (HTTP, Fetch, cURL, XHR), streaming, proxy support (HTTP/HTTPS/SOCKS), and cross-environment compatibility.
Maintainers
Readme
Enterprise-grade HTTP client for Node.js 22+, Bun, Deno, browsers, React Native, and edge runtimes. One API everywhere — HTTP/2, cookies, proxy rotation, stealth mode, web crawling, and 70+ structured error codes out of the box.
Install
npm install rezoyarn add rezo # or
pnpm add rezo # or
bun add rezoQuick Start
import rezo from 'rezo';
// GET
const { data } = await rezo('https://api.example.com/users');
// POST with JSON
const { data: user } = await rezo.postJson('https://api.example.com/users', {
name: 'Ada Lovelace',
email: '[email protected]'
});
// Create an instance
const client = rezo.create({
baseURL: 'https://api.example.com',
timeout: 5000,
headers: { 'Authorization': 'Bearer token' }
});
const { data: posts } = await client.get('/posts');What's Included
- Cookie Jar — Auto-persistence in JSON and Netscape formats
- Proxy Rotation — HTTP, HTTPS, SOCKS4, SOCKS5 with health monitoring
- Stealth Mode — 18 browser profiles with TLS fingerprinting
- Web Crawler — SQLite persistence, robots.txt, auto-throttle, resumable
- Request Queue — Priority, per-domain concurrency, rate limiting
- Streaming — EventEmitter with progress and lifecycle events
- Downloads & Uploads — Progress, speed, and ETA tracking
- Retry — Exponential/linear backoff with custom conditions
- Staged Timeouts — Separate connect, headers, body, and total phases
- Response & DNS Cache — ETag/Last-Modified revalidation
- Site Cloning — Wget-style mirroring with link conversion
- TypeScript — Strict types, generics, overloads from the ground up
Adapters
Rezo selects the optimal adapter for your runtime automatically.
| Adapter | Runtime | Cookies | Proxy | HTTP/2 | Streaming | |---|---|---|---|---|---| | HTTP | Node.js, Bun | ● | ● | | ● | | HTTP/2 | Node.js, Bun | ● | ● | ● | ● | | cURL | Node.js | ● | ● | ● | ● | | Fetch | Browsers, Deno, Edge | | | | ● | | XHR | Browsers | | | | | | React Native | iOS, Android | Partial | | | Optional |
React Native uses a dedicated adapter. Base RN support covers buffered requests, retries, timeout/abort, hooks, cookies, and adapter-managed redirects. File downloads, provider-backed upload/download progress, readable streaming, NetInfo preflight, and background-task workflows are enabled through optional RN providers.
Examples
Proxy rotation with stealth:
import rezo, { RezoStealth } from 'rezo';
const client = rezo.create({
stealth: RezoStealth.chrome(),
proxyManager: {
proxies: ['socks5://proxy1:1080', 'http://proxy2:8080'],
rotation: { strategy: 'random' },
autoDisableDeadProxies: true
}
});
const { data } = await client.get('https://protected-site.com');Download with progress:
const download = await rezo.download(
'https://example.com/file.zip',
'./file.zip'
);
download.on('progress', (p) => console.log(`${p.percentage}%`));Streaming:
const stream = await rezo.stream('https://api.example.com/events');
stream.on('data', (chunk) => process.stdout.write(chunk));React Native provider setup:
import rezo, {
createReactNativeFsAdapter,
createNetInfoProvider,
} from 'rezo/platform/react-native';
import RNFS from 'react-native-fs';
import NetInfo from '@react-native-community/netinfo';
const api = rezo.create({
reactNative: {
fileSystemAdapter: createReactNativeFsAdapter(RNFS, { background: true }),
networkInfoProvider: createNetInfoProvider(NetInfo),
}
});26 lifecycle hooks:
const client = rezo.create({
hooks: {
beforeRequest: [(config) => { /* modify config */ }],
afterResponse: [(response) => response],
onDns: [(event) => { /* DNS resolved */ }],
onTls: [(event) => { /* TLS handshake done */ }],
beforeRetry: [(config, error) => { /* about to retry */ }],
}
});Documentation
Full documentation at rezo-http.dev
- Installation
- Quick Start
- API Reference
- Adapters
- Stealth Mode
- Web Crawler
- Error Handling
- Hooks
- Switching from another library?
License
MIT — Made with care by Yuniq Solutions Tech. Built by developers, for developers.
