Faster than Express and Fastify
Same app, same runtime, same machine: more requests per second on both JSON reads and JSON writes.
You can, and it works. But every request pays for a Node compatibility layer. Going straight to Bun's native server removes it, and brings Web-standard primitives with it.
Faster than Express and Fastify
One-line migration
new BunAdapter() to NestFactory.create(). Controllers, pipes, guards, filters,
middleware and @Res() handlers stay as they are.
Web standards underneath
Requests, responses become Web Responses, files stream with
zero-copy Bun.file(). Express-shaped req/res keep the ecosystem working.
Tests without sockets
adapter.fetch(new Request(...)) runs a request through the full Nest pipeline in-process. No
supertest, no port, no flakiness.
bun run bench reproduces it.| Adapter | GET /users/:id | POST /users |
|---|---|---|
| platform-express | 93,449 req/s | 71,763 req/s |
| platform-fastify | 116,358 req/s | 91,533 req/s |
| @nestbun/platform | 119,022 req/s | 98,124 req/s |
| Bun.serve | 157,694 req/s | 153,660 req/s |
Every item is covered by an integration test that boots a real Nest application on the adapter.
Routing and decorators
@All, HEAD → GET fallback, first-match order like Express. @Body,
@Query, @Param, @Headers, @Ip, @Req,
@Res, @Next, @Redirect, @Header, @HttpCode.
Body parsing
rawBody for webhooks, size limits with
413, Express-identical 400 shapes for bad JSON.
Middleware, prefix, versioning
MiddlewareConsumer with forRoutes, exclude and method scoping,
app.use(), next(err), global prefix, URI / header / media-type versioning, CORS.
Streaming
StreamableFile, manual res.write(),
zero-copy file sends.
Static files and views
useStaticAssets with ETag, Last-Modified and 304; ejs, hbs,
pug or any render() function.
Ecosystem and lifecycle
@nestjs/swagger and @nestjs/testing untouched. HTTPS, graceful shutdown with a drain
timeout, forceCloseConnections, unix sockets.