npm.io
2.0.0 • Published 2h ago

@hyperttp/ratelimit

Licence
MIT
Version
2.0.0
Deps
0
Size
44 kB
Vulns
0
Weekly
0

@hyperttp/ratelimit

English | Русский

Rate limiting plugin for Hyperttp.

Features

  • Limits request throughput in the Core v2 pipeline.
  • Supports protocol-neutral SendRequest, UniversalResponse, and RequestContext values.
  • Helps keep client traffic within downstream service limits.

Installation

npm install @hyperttp/ratelimit
# or
bun add @hyperttp/ratelimit

Usage

import { HyperClient } from "hyperttp";
import { withRateLimit } from "@hyperttp/ratelimit";

const client = new HyperClient({
  plugins: [withRateLimit()],
});

Configure the plugin with the exported RateLimitOptions type.

License

MIT dirold2

Keywords