Introduction
The minimalist, high-performance web framework for Bun.
Welcome to Bklar 🐰
Bklar (pronounced buh-klar) is a modern web framework built specifically for Bun.
It is designed to be incredibly fast by leveraging native Bun APIs, while offering a Developer Experience (DX) comparable to sophisticated frameworks like NestJS or Hono, but with a much simpler surface area.
Why Bklar?
🚀 Native Speed
Built directly on Bun.serve and Bun.file. No Node.js compatibility
layers slowing you down.
🛡️ Type Safe
First-class Zod integration. Input validation and type inference work out of the box.
🔌 Battery Included
Everything you need (Logger, CORS, JWT, Rate Limit, Swagger) is available as an official, optimized package.
⚡ Realtime
Native WebSocket support integrated directly into the router. No complex setup required.
Quick Look
Here is a complete API with validation and Swagger documentation in just a few lines:
import { Bklar } from "bklar";
import { z } from "zod";
const app = Bklar();
app.get(
"/users/:id",
(ctx) => {
// ctx.params.id is strictly typed!
return ctx.json({ id: ctx.params.id, name: "Bun User" });
},
{
schemas: {
params: z.object({ id: z.coerce.number() }),
},
doc: {
summary: "Get User",
tags: ["Users"],
},
}
);
app.listen(3000);The Ecosystem
Bklar isn't just a router; it's a suite of tools designed to work perfectly together.
Security Suite
Helmet, CORS, Rate Limit & JWT
Performance Tools
Caching, Compression & Static Files
Utilities
File Uploads, Cron Jobs & Logger
Documentation
Auto-generated OpenAPI & Swagger UI
Getting Started
Ready to build? Create your first project in seconds.
The fastest way to start.
bun create bklar my-appAdd it to an existing project.
bun add bklar zodRequirements