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

@hyperttp/core

v1.5.6

Published

High-performance, extensible HTTP client for Node.js, Bun, Deno and Browser

Readme

@hyperttp/core ⚡

High-performance HTTP engine for Node.js and Bun.

English | Русский

npm version npm downloads bundle size license typescript


What is @hyperttp/core?

@hyperttp/core is a low-level, high-performance HTTP engine designed for building fast, extensible HTTP clients and SDKs.

It provides:

  • ⚡ Optimized request execution pipeline
  • 🔀 Runtime-aware transport abstraction
  • 🔌 Plugin lifecycle hooks
  • 🛡️ Safe request/response handling
  • 📦 Zero runtime dependencies

@hyperttp/core is the foundation that powers hyperttp, but it can also be used directly to build custom HTTP clients, SDKs, API wrappers and internal tooling.

💡 Looking for a batteries-included client?

Use hyperttp — it ships with retries, caching, parsing, rate limiting and other plugins already configured.


Why @hyperttp/core?

Unlike the native fetch(), HyperCore is designed as an extensible HTTP engine rather than just a request API.

| Feature | fetch | @hyperttp/core | | ---------------------- | :---: | :------------: | | Transport abstraction | ❌ | ✅ | | Plugin pipeline | ❌ | ✅ | | Request/Response hooks | ❌ | ✅ | | Custom transports | ❌ | ✅ | | Built for SDKs | ⚠️ | ✅ | | Safe response cleanup | ❌ | ✅ | | Runtime auto-detection | ❌ | ✅ |


Features

  • ⚡ Optimized hot paths with minimal allocations
  • 🚀 Fast manual query string serialization
  • 🔀 Automatic runtime transport selection
  • 🔌 Extensible plugin system
  • 🧠 Request/response lifecycle hooks
  • 🛡️ Protection against Prototype Pollution
  • 🛡️ CRLF header validation
  • 🛡️ Safe ArrayBuffer handling
  • 📦 Zero runtime dependencies
  • 🌊 Native stream support
  • 🧹 Automatic resource cleanup
  • 📈 Designed for high concurrency

Architecture

                  hyperttp
                      │
                      ▼
              @hyperttp/core
                      │
      ┌───────────────┴───────────────┐
      │                               │
      ▼                               ▼
 Transport Layer              Plugin Pipeline
      │                               │
      ├── BunTransport                │
      ├── UndiciTransport             ├── Retry
      ├── NodeTransport               ├── Cache
      ├── BrowserTransport            ├── Parser
      └── Custom Transport            └── Пользовательские плагины

Installation

npm install @hyperttp/core

Recommended transports:

# Bun
npm install @hyperttp/transport-bun

# Node.js
npm install @hyperttp/transport-undici

Quick Start

import { HyperCore } from "@hyperttp/core";

const http = new HyperCore({
  network: {
    baseURL: "https://api.example.com",
    headers: {
      "X-App-Version": "1.0.0",
    },
  },
});

const response = await http.get("/users", {
  query: {
    page: 1,
    limit: 20,
  },
});

const users = await response.json();

console.log(users);

Error Handling

import { HyperCore, HttpClientError, TimeoutError } from "@hyperttp/core";

try {
  const res = await http.get("/users");

  console.log(await res.json());
} catch (error) {
  if (TimeoutError.isTimeoutError(error)) {
    console.error("Request timed out.");
  }

  if (HttpClientError.isHttpClientError(error)) {
    console.error(error.statusCode, error.message);
  }

  throw error;
}

Streaming

Read a streaming response:

const response = await http.stream("https://stream.example.com/audio");

const reader = response.body.getReader();

while (true) {
  const { done, value } = await reader.read();

  if (done) break;

  console.log(value.length);
}

Discard a response body without buffering:

await http.dump("https://api.example.com/ping");

Plugins

HyperCore exposes request lifecycle hooks that allow intercepting requests, responses and errors.

http.use({
  name: "logger",
  priority: 10,

  onRequest(req) {
    req.meta.start = performance.now();
  },

  onResponse(res, req) {
    const elapsed = performance.now() - (req.meta.start as number);

    console.log(`${req.method} ${req.url} -> ${res.status} (${elapsed.toFixed(2)} ms)`);
  },

  onError(error, req) {
    console.error(`${req.url}: ${error.message}`);
  },
});

Transports

HyperCore automatically detects the current runtime, or you can provide your own transport.

| Transport | Runtime | | ---------------- | ------------- | | BunTransport | Bun | | UndiciTransport | Node.js | | NodeTransport | Bun / Node.js | | BrowserTransport | Browser | | Custom Transport | Any |

Example:

import { HyperCore } from "@hyperttp/core";
import { UndiciTransport } from "@hyperttp/transport-undici";

const http = new HyperCore({
  customTransport: new UndiciTransport(),
});

Performance

HyperCore is optimized for sustained high concurrency.

Recent stress testing:

  • 200,000 requests
  • 1000 concurrent connections
  • 120 seconds
  • 0 request errors

Optimizations include:

  • minimal allocations
  • object reuse
  • optimized semaphore
  • manual query serialization
  • efficient header normalization
  • zero-dependency core

Ecosystem

| Package | Description | | ---------------------------- | ------------------------ | | hyperttp | Ready-to-use HTTP client | | @hyperttp/core | HTTP engine | | @hyperttp/parser | Response parsing | | @hyperttp/cache | Cache utilities | | @hyperttp/transport-undici | Undici transport | | @hyperttp/transport-bun | Bun transport |


Development

bun install

bun run lint
bun run typecheck
bun run test
bun run build

License

MIT