Skip to content
v1.11.1 released · View on GitHub ↗

Nestelia

Modular framework for Elysia and Bun.
Decorators · DI · Modules · Elysia speed.

Decorator-driven Routing

@Controller, @Get, @Post, @Body and more — a clean, declarative decorator API running natively on Elysia.

Nestelia maps each decorated route directly to an Elysia handler, giving you full type inference and schema validation at the framework layer.

users.controller.ts
import { Controller, Get, Post, Body } from 'nestelia'
import { CreateUserDto } from './dto'

@Controller('/users')
export class UsersController {

  @Get()
  findAll() {
    return { users: [] }
  }

  @Post()
  create(@Body() dto: CreateUserDto) {
    return dto
  }
}

Dependency Injection

Constructor-based DI with singleton, transient, and request scopes powered by reflect-metadata.

Mark any class with @Injectable() and declare it as a provider — nestelia resolves the full dependency graph automatically at bootstrap.

users.service.ts
import { Injectable } from 'nestelia'

@Injectable()
export class UsersService {
  private users: User[] = []

  async findAll(): Promise<User[]> {
    return this.users
  }

  async create(dto: CreateUserDto): Promise<User> {
    this.users.push(dto)
    return dto
  }
}

Modular Architecture

Encapsulate controllers, providers, and imports into cohesive, reusable modules with a clear, explicit structure.

One call to createElysiaApplication wires up the entire dependency graph and returns a ready Elysia instance.

main.ts
import 'reflect-metadata'
import { createElysiaApplication } from 'nestelia'
import { AppModule } from './app.module'

const app = await createElysiaApplication(AppModule)

app.listen(3000)
// Listening on http://localhost:3000

Performance

NestJS-style DX at Elysia-level speed — near-zero overhead from decorators and DI.

1.7x faster than Fastify
1.9x faster than Express
2.3x faster than NestJS
ElysiaBun
74,395 reqs/s
NesteliaBun
71,703 reqs/s
FastifyNode
42,640 reqs/s
ExpressNode
37,825 reqs/s
NestJSNode
30,582 reqs/s
Measured in requests/second. GET / → plain text 'Hello World'. 500 connections, 10s duration.

Released under the MIT License.