Itโs a 97kB (2.4kB gzipped) Bun-native framework that hits 21,748 req/s.
๐ Why PrinceJS?
Most "fast" frameworks are just bare-bones routers. PrinceJS is a Super-Framework. Itโs tiny but has "batteries included":
โ
Built-in SQLite ORM (Powered by Bun.sqlite)
โ
Native Cron Scheduler (No extra npm packages needed)
โ
Functional JSX Rendering (Clean UI without the React bloat)
โ
OpenAPI/Swagger Generation (Auto-sync your docs)
โ
Validation with Zod
โก The Benchmarks (oha -c 100 -z 30s)
On an Intel i7-6600U, PrinceJS matches the giants:
| Framework | Req/s | Size (Gzipped) |
|---|---|---|
| PrinceJS | 21,748 | 2.4 kB |
| Hono | 22,124 | 7.5 kB |
| Elysia | 25,312 | 64.8 kB |
| Express | 9,325 | ~2 MB |
๐ ๏ธ Minimalist DX
typescript
import { prince } from "princejs";
import { Html, Body, H1, render } from "princejs/jsx";
const app = prince();
app.get("/", () => render(
Html(Body(H1("Hello from PrinceJS!")))
));
app.listen(3000);
Top comments (4)
2.4kB gzipped with a built-in ORM, cron scheduler, AND JSX rendering? That's a wild feature density for the bundle size. Most frameworks pick two of those and already blow past 50kB.
A couple questions since I'm curious about the internals:
How are you handling the SQLite ORM? Is it just a thin wrapper around Bun's native
bun:sqliteor did you build a query builder with migration support?The functional JSX approach is interesting โ are you using Bun's built-in JSX transform, or did you roll your own? Because if it's just string concatenation under the hood (which is totally valid for server rendering), that'd explain how you keep the size down.
For the benchmarks โ were these all running the same route handler (just returning a string/JSON)? Would be cool to see numbers with middleware chains and the ORM doing actual queries, since that's where frameworks usually diverge.
Keep shipping. At 13 you're building stuff most devs in their 20s haven't attempted.
That so amazing, do you have a working project using this framework, could you share an a TODO list project or something.
great work, champ.
thanks boss