HYPERJS.AI

RATE-LIMIT

v0.1.0Token-bucket rate limiting for Hyper. In-memory + pluggable stores.

$ hyper add rate-limit

Copies 2 files into src/hyper/rate-limit/ and updates hyper.lock.json.

DEPS

FILES

README

@hyper/rate-limit

Token-bucket rate limiting for Hyper. In-memory + pluggable stores.

Install

Components are installed as source into your repo, not pulled from npm:

bunx hyper add rate-limit

Wires the alias @hyper/rate-limit to src/hyper/rate-limit/ (configurable in hyper.config.json). See hyperjs.ai for the full registry.

Usage

import { Hyper } from "@hyper/core"
import { authRateLimitPlugin, rateLimit } from "@hyper/rate-limit"

export default new Hyper()
  .use(rateLimit({ max: 100, windowMs: 60_000 }))
  .use(authRateLimitPlugin())
  .listen(3000)

Docs

See the main README and docs/ for guides and integration recipes.

License

MIT

MANIFEST