Getting started
Requires Bun 1.4 or newer (bun upgrade) and NestJS 12 or newer.
Start a new project
Section titled “Start a new project”bun create @nestbun my-api --adapter bunAdd it to an existing project
Section titled “Add it to an existing project”bun add @nestbun/platformThen pass it to NestFactory.create(). This is the only code change:
import { NestFactory } from '@nestjs/core';import { BunAdapter, type NestBunApplication } from '@nestbun/platform';import { AppModule } from './app.module.js';
const app = await NestFactory.create<NestBunApplication>(AppModule, new BunAdapter());await app.listen(3000);See Migrating from Express for the handful of things worth checking in a larger app.
Next steps
Section titled “Next steps”- Configuration for adapter and
Bun.serve()options. - Testing without a port to drop supertest.
- Compatibility for what works and what is planned.