JSPM

  • Created
  • Published
  • Downloads 80
  • Score
    100M100P100Q99318F
  • License MIT

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

Package Exports

  • @hyperttp/core
  • @hyperttp/core/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@hyperttp/core) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@hyperttp/core ๐Ÿš€

English | ะ ัƒััะบะธะน


๐ŸŒ Language / ะฏะทั‹ะบ


High-performance HTTP core for Node.js and Bun built on top of undici.

@hyperttp/core is designed for:

  • stable p90/p99 latency,
  • predictable behavior under load,
  • tail-latency reduction,
  • high throughput performance,
  • low overhead transport-layer abstraction.

Features

  • โšก High performance HTTP execution layer
  • ๐Ÿ“‰ Stable p90/p99 latency under load
  • ๐Ÿ”„ Keep-Alive & connection pooling
  • ๐ŸŒŠ Stream response support
  • ๐Ÿช CookieAgent integration
  • ๐Ÿ“ˆ Request metrics tracking
  • ๐Ÿ”ง Flexible network-layer configuration
  • โ™ป๏ธ Retry & redirect handling
  • ๐Ÿงฉ Simple API over undici

Performance

@hyperttp/core provides:

  • minimal p99 latency among most HTTP clients,
  • throughput close to undici,
  • significantly more stable latency under load.

Benchmark

Test configuration

Requests      20000
Concurrency   200
Warmup        500
Timeout       60000 ms
Runtime       Node.js

Benchmark executed via:

npx tsx ./bench.ts

Benchmark results

Client RPS Avg p99 Heap
undici 9.86K 20.22ms 203.05ms 155 MB
@hyperttp/core 9.04K 22.10ms 29.14ms 295 MB
hyperttp 7.10K 28.12ms 40.02ms 272 MB
fetch 5.78K 34.47ms 322.17ms 289 MB
ky 4.50K 44.35ms 440.24ms 374 MB
axios 4.08K 48.76ms 54.92ms 238 MB
node-fetch 3.62K 55.10ms 83.60ms 434 MB
got 3.06K 65.31ms 96.38ms 164 MB
superagent 2.96K 67.29ms 78.96ms 81.1 MB

Why p99 matters

Most HTTP clients look good on average latency but suffer from high tail latency under load.

@hyperttp/core is optimized for:

  • stable scheduling behavior,
  • predictable concurrency,
  • minimized latency spikes,
  • burst workload stability.

Installation

Bun

bun add @hyperttp/core

npm

npm install @hyperttp/core

Quick start

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

const core = new HyperCore({
  verbose: true,
});

const response = await core.get("http://localhost:3000/json");

console.log(response.body);

Configuration

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

const core = new HyperCore({
  verbose: true,

  trackMetrics: true,

  network: {
    timeout: 30000,
    maxConcurrent: 500,
    pipelining: 10,
    keepAliveTimeout: 30000,
    allowHttp2: true,
    followRedirects: true,
    maxRedirects: 5,
  },

  retry: {
    maxRetries: 3,
  },
});

Stream API

import fs from "node:fs";

const stream = await core.stream("https://example.com/file.zip");

stream.body.pipe(fs.createWriteStream("./file.zip"));

Metrics

const core = new HyperCore({
  trackMetrics: true,
});

const response = await core.get("https://api.example.com");

console.log(response.meta?.timings);

Example:

{
  networkMs: 12.41;
}

Runtime support

  • Node.js 18+
  • Bun

Built on

  • undici
  • http-cookie-agent

License

MIT