Bun Installation

Install hitlimit for Bun using the Bun package manager.

Install the Package

bun add @joint-ops/hitlimit-bun

The hitlimit-bun package is optimized specifically for Bun and includes native SQLite store support out of the box.

Verify Installation

Create a test file to verify the installation:

test.ts
import { hitlimit } from '@joint-ops/hitlimit-bun'

const limiter = hitlimit({ limit: 10, window: '1m' })

console.log('hitlimit-bun installed successfully!')

Run the test:

bun run test.ts

Optional Dependencies

For Redis support in Bun, install the ioredis peer dependency:

bun add ioredis

Requirements

  • Bun: v1.0.0 or higher
  • TypeScript: v5.0 or higher (optional but recommended)

Next Steps

Now that you have hitlimit-bun installed, proceed to the Quick Start guide.