npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ahmetshbz/zap

v1.1.3

Published

⚡ Lightning-fast HTTP client - 145% faster than fetch with enterprise features: deduplication, retry, caching, security

Readme

@ahmetshbz/zap

🚀 Enterprise-grade HTTP Client - Production-ready, type-safe, universal HTTP client for modern JavaScript/TypeScript applications.

Features

🔒 Security

  • Request Signing - AWS Signature v4 style request signing
  • OAuth 2.0 / OIDC - Token management with auto-refresh and PKCE support
  • TLS/SSL - Certificate pinning and validation
  • SSRF Protection - Prevent Server-Side Request Forgery attacks
  • Secrets Management - Secure credential storage with encryption

⚡ Performance

  • Multi-layer Caching - L1 (memory) + L2 (Redis) with LRU/LFU/ARC algorithms
  • Request Deduplication - Coalesce identical concurrent requests
  • Compression - Automatic gzip, brotli, deflate support
  • Streaming - Upload/download streaming with progress tracking
  • Resume Support - Resume interrupted downloads

🛡️ Resilience

  • Advanced Retry - Exponential backoff with decorrelated jitter
  • Circuit Breaker - Prevent cascading failures
  • Rate Limiting - Token bucket, sliding window algorithms
  • Timeout Management - Per-request and global timeouts
  • Bulkhead Pattern - Isolate failures

Installation

bun add @ahmetshbz/zap

Quick Start

import { HttpClient } from '@ahmetshbz/zap';

const client = new HttpClient({
  baseURL: 'https://api.example.com',
  timeout: 5000,
});

// Simple requests
const data = await client.get('/users/1');
const created = await client.post('/users', { name: 'John' });

Configuration Examples

Security

const client = new HttpClient({
  baseURL: 'https://api.example.com',
  securityConfig: {
    signing: {
      enabled: true,
      algorithm: 'AWS4-HMAC-SHA256',
      accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
      secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
    },
    oauth: {
      enabled: true,
      clientId: process.env.OAUTH_CLIENT_ID!,
      clientSecret: process.env.OAUTH_CLIENT_SECRET!,
      tokenUrl: 'https://auth.example.com/token',
    },
  },
});

Performance

const client = new HttpClient({
  cacheConfig: {
    enabled: true,
    algorithm: 'lru',
    maxSize: 1000,
    defaultTtl: 60000,
  },
  compressionConfig: {
    enabled: true,
    preferredAlgorithms: ['br', 'gzip'],
  },
  streamConfig: {
    enableUploadProgress: true,
    enableDownloadProgress: true,
  },
});

Resilience

const client = new HttpClient({
  resilienceConfig: {
    retry: {
      enabled: true,
      maxAttempts: 3,
      jitterType: 'decorrelated',
    },
    circuitBreaker: {
      enabled: true,
      failureThreshold: 5,
    },
    rateLimit: {
      enabled: true,
      maxRequests: 100,
      windowMs: 60000,
    },
  },
});

Advanced Features

Progress Tracking

await client.post('/upload', fileData, {
  onUploadProgress: (progress) => {
    console.log(`${progress.percentage}% - ${progress.rate} B/s`);
  },
});

Interceptors

const client = new HttpClient({
  onRequest: async (ctx) => {
    ctx.options.headers = {
      ...ctx.options.headers,
      Authorization: `Bearer ${await getToken()}`,
    };
  },
  onResponse: async (ctx) => {
    return { ...ctx.response._data, timestamp: Date.now() };
  },
});

Cache Management

import { MultiLayerCache } from '@ahmetshbz/zap';

const cache = new MultiLayerCache(l1Config, l2Config);
await cache.set('key', data, { ttl: 60000, tags: ['users'] });
await cache.invalidateByTags(['users']);

TypeScript

Fully typed with TypeScript 5.0+:

interface User {
  id: number;
  name: string;
}

const user = await client.get<User>('/users/1');
// user is typed as User

Runtime Support

✅ Node.js 18+ | ✅ Bun | ✅ Deno | ✅ Browser | ✅ Edge Runtime

License

MIT