@velajs/vela
v0.6.1
Published
NestJS-compatible framework for edge runtimes, powered by Hono
Maintainers
Readme
@velajs/vela
NestJS-compatible framework for edge runtimes, powered by Hono.
Install
pnpm add @velajs/velaQuick Start
import { VelaFactory, Controller, Get, Module, Injectable } from '@velajs/vela';
@Injectable()
class AppService {
getHello() {
return { message: 'Hello from the edge!' };
}
}
@Controller('/app')
class AppController {
constructor(private appService: AppService) {}
@Get('/')
hello() {
return this.appService.getHello();
}
}
@Module({
controllers: [AppController],
providers: [AppService],
})
class AppModule {}
const app = await VelaFactory.create(AppModule);
export default app; // Works on Cloudflare Workers, Deno, Bun, etc.Features
- Decorator-based controllers —
@Controller,@Get,@Post,@Put,@Patch,@Delete - Dependency injection —
@Injectable,@Inject,InjectionToken, singleton/transient/request scopes - Modules —
@Modulewith imports, exports, controllers, providers - Guards —
@UseGuardswithCanActivateinterface - Pipes —
@UsePipes, built-inParseIntPipe,ParseBoolPipe,ZodValidationPipe, etc. - Interceptors —
@UseInterceptorswithNestInterceptorinterface - Exception filters —
@UseFilters,@Catch, built-in HTTP exceptions - Middleware —
@UseMiddlewarefor Hono-native middleware - Custom metadata —
@SetMetadata+Reflector - Custom param decorators —
createParamDecorator - Route versioning —
@Controller({ version: '1' })+@Version('2') - Global prefix —
app.setGlobalPrefix('/api') - Lifecycle hooks —
OnModuleInit,OnApplicationBootstrap,OnModuleDestroy - CRUD integration — Optional
@velajs/crudpackage
Edge Runtime Compatibility
Vela runs on any runtime that supports the Web Standards API:
- Cloudflare Workers
- Deno Deploy
- Bun
- Node.js 20+
- Vercel Edge Functions
No Node.js-specific APIs (node:fs, Buffer, process) are used.
CRUD Module (Optional)
pnpm add @velajs/crud hono-crud @hono/zod-openapi zodSee @velajs/crud for documentation.
License
MIT
