nestelia
v1.7.1
Published
Modular framework with decorators, dependency injection, modules and lifecycle hooks for Elysia
Maintainers
Readme
nestelia
Modular framework with decorators, dependency injection, modules, and lifecycle hooks for Elysia.
Documentation · npm · GitHub
Features
- Decorators —
@Controller,@Get,@Post,@Body,@Param, and more - Dependency Injection — constructor-based DI with singleton, transient, and request scopes
- Modules — encapsulate controllers, providers, and imports
- Lifecycle Hooks —
OnModuleInit,OnApplicationBootstrap,OnModuleDestroy - Guards, Interceptors, Pipes — request pipeline extensibility
- Middleware — class-based and functional
- Exception Handling — built-in HTTP exceptions and custom filters
- Swagger — automatic OpenAPI documentation from decorators
Installation
Requires Elysia as a peer dependency.
bun add nestelia elysiaQuick Start
import "reflect-metadata";
import { Controller, Get, Injectable, Module, createElysiaApplication } from "nestelia";
@Injectable()
class GreetingService {
greet(name: string) {
return `Hello, ${name}!`;
}
}
@Controller("/")
class AppController {
constructor(private readonly greeting: GreetingService) {}
@Get("/hello/:name")
hello(@Param("name") name: string) {
return this.greeting.greet(name);
}
}
@Module({
controllers: [AppController],
providers: [GreetingService],
})
class AppModule {}
const app = await createElysiaApplication(AppModule);
app.listen(3000, () => console.log("Listening on http://localhost:3000"));Packages
All subpath exports are part of the single nestelia package.
| Import path | Description |
|-------------|-------------|
| nestelia/scheduler | Cron jobs, intervals, and timeouts |
| nestelia/microservices | Redis, RabbitMQ, TCP transports |
| nestelia/apollo | Apollo GraphQL code-first |
| nestelia/passport | Passport.js authentication |
| nestelia/testing | Isolated test modules with provider overrides |
| nestelia/cache | Response caching with decorators |
| nestelia/rabbitmq | Advanced RabbitMQ messaging |
| nestelia/graphql-pubsub | Redis PubSub for GraphQL subscriptions |
Documentation
Full documentation is available at nestelia.dev (powered by VitePress).
To run docs locally:
bun run docs:devClaude Code Skill
A Claude Code skill is available for nestelia. It provides scaffolding templates, decorator usage, and best practices directly in your AI assistant.
npx skills add nestelia/nesteliaOnce installed, Claude Code will automatically use the correct patterns when working with nestelia.
