https://github.com/iamrony777/hono-slow-down
Slow Down Hono!
https://github.com/iamrony777/hono-slow-down
hono hono-middleware honojs limit middleware slowdown
Last synced: about 2 months ago
JSON representation
Slow Down Hono!
- Host: GitHub
- URL: https://github.com/iamrony777/hono-slow-down
- Owner: iamrony777
- License: mit
- Created: 2025-08-28T19:18:07.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-08-28T20:02:28.000Z (about 2 months ago)
- Last Synced: 2025-08-29T01:29:49.782Z (about 2 months ago)
- Topics: hono, hono-middleware, honojs, limit, middleware, slowdown
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/hono-slow-down
- Size: 12.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Hono Slow Down
This is a middleware for Hono that allows you to slow down your API responses.
## Installation
```sh
bun add hono-slow-down
```
## Usage
```typescript
import { Hono } from 'hono'
import { queueMiddleware } from 'hono-slow-down'
const app = new Hono()
app.use('*', queueMiddleware({
queueLimit: 100, // Max 100 requests waiting, set to 0 for unlimited
concurrency: 5, // Process up to 5 requests concurrently
timeout: 10000, // 10 second timeout, set to 0 for no timeout
}))
```
See [example.ts](./src/example.ts) for a complete example.