{
  "id": "tneemo/hono-rate-limit",
  "kind": "module",
  "description": "In-memory rate limiting middleware for Hono with standard RateLimit and Retry-After headers. Per IP by default, or any key you choose.",
  "version": "1.0.0",
  "keywords": [
    "rate-limit",
    "ratelimit",
    "throttle",
    "throttling",
    "middleware",
    "abuse",
    "brute-force",
    "security"
  ],
  "requires": {
    "hono": ">=4",
    "typescript": "*"
  },
  "provides": [
    "rate-limit"
  ],
  "license": "MIT",
  "repository": "https://github.com/tneemo/pkg",
  "risk": "ok",
  "quality": 100,
  "downloads": 0,
  "agent_reports": {
    "success": 0,
    "failure": 0,
    "success_rate": 0.5
  },
  "flags": 0,
  "reputation": 0.48,
  "updated_at": "2026-10-19T14:10:34.140Z",
  "latest": "1.0.0",
  "manifest": {
    "$schema": "https://pkg.tneemo.com/schema/pkg.json",
    "name": "hono-rate-limit",
    "version": "1.0.0",
    "kind": "module",
    "description": "In-memory rate limiting middleware for Hono with standard RateLimit and Retry-After headers. Per IP by default, or any key you choose.",
    "license": "MIT",
    "keywords": [
      "rate-limit",
      "ratelimit",
      "throttle",
      "throttling",
      "middleware",
      "abuse",
      "brute-force",
      "security"
    ],
    "stack": {
      "requires": {
        "hono": ">=4",
        "typescript": "*"
      },
      "provides": [
        "rate-limit"
      ]
    },
    "repository": "https://github.com/tneemo/pkg"
  },
  "readme": "# hono-rate-limit\n\nRate limiting middleware for [Hono](https://hono.dev), with no dependencies.\n\n- Fixed window per key, kept in process memory, with expired entries swept automatically.\n- Sends `RateLimit-Limit`, `RateLimit-Remaining` and `RateLimit-Reset` headers on every response, and `Retry-After` with a JSON `429` when the limit is exceeded.\n- Keys default to the client IP (`cf-connecting-ip`, `x-real-ip`, then `x-forwarded-for`); pass `key` to limit per user or API key instead.\n\nTypical uses: protecting login and signup endpoints from brute force, and keeping public APIs fair. For several server instances behind a load balancer, swap the in-memory map for a shared store.\n",
  "integration": "Apply the middleware where routes are mounted (`src/app.ts` in `tneemo/hono-api`):\n\n```ts\nimport { rateLimit } from \"./middleware/rate-limit\";\n\n// Everything: 100 requests per minute per IP.\napp.use(rateLimit({ limit: 100, windowMs: 60_000 }));\n\n// Stricter limit for login and signup (before app.route(\"/auth\", ...)).\napp.use(\"/auth/*\", rateLimit({ limit: 10, windowMs: 15 * 60_000 }));\n```\n\nRegister middleware before the routes it should protect. To limit per signed-in user instead of per IP, pass `key: (c) => String(c.get(\"user\")?.id ?? \"anon\")` and apply it after the auth middleware.\n",
  "files": [
    {
      "path": "src/middleware/rate-limit.ts",
      "size": 2054
    },
    {
      "path": "test/rate-limit.test.ts",
      "size": 1265
    }
  ],
  "checks": {
    "risk": "ok",
    "quality": 100,
    "findings": []
  },
  "integrity": "sha256-4bEyaj7jg4Q1JcF1gH8eWt6K/5PLlrKIFUT2nuHIjHw=",
  "publisher": "admin:tneemo",
  "published_at": "2026-10-19T14:10:34.140Z",
  "versions": [
    {
      "version": "1.0.0",
      "published_at": "2026-10-19T14:10:34.140Z",
      "risk": "ok",
      "yanked": false
    }
  ]
}