@kiyasov/elysia-nest
v1.0.17
Published
Modular framework with decorators, dependency injection, modules and lifecycle hooks for Elysia
Maintainers
Readme
elysia-nest
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 @kiyasov/elysia-nest elysiaQuick Start
import "reflect-metadata";
import { Controller, Get, Injectable, Module, createElysiaApplication } from "@kiyasov/elysia-nest";
@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 @kiyasov/elysia-nest package.
| Import path | Description |
|-------------|-------------|
| @kiyasov/elysia-nest/scheduler | Cron jobs, intervals, and timeouts |
| @kiyasov/elysia-nest/microservices | Redis, RabbitMQ, TCP transports |
| @kiyasov/elysia-nest/apollo | Apollo GraphQL code-first |
| @kiyasov/elysia-nest/passport | Passport.js authentication |
| @kiyasov/elysia-nest/testing | Isolated test modules with provider overrides |
| @kiyasov/elysia-nest/cache | Response caching with decorators |
| @kiyasov/elysia-nest/rabbitmq | Advanced RabbitMQ messaging |
| @kiyasov/elysia-nest/graphql-pubsub | Redis PubSub for GraphQL subscriptions |
Documentation
Full documentation is available at kiyasov.github.io/elysia-nest (powered by VitePress).
To run docs locally:
bun run docs:devClaude Code Skill
A Claude Code skill is available for elysia-nest. It provides scaffolding templates, decorator usage, and best practices directly in your AI assistant.
npx skills add kiyasov/elysia-nestOnce installed, Claude Code will automatically use the correct patterns when working with @kiyasov/elysia-nest.
