dp-koa-framework-core is a v2 upgrade of the DP-Koa framework core at version 0.1.8, a lightweight, decorator-driven Node.js web framework built on Koa. It enables class-based controllers with decorators for routing (@Get, @Post, @Put, @Del, @All), parameter injection (@Body, @Query, @Params, @State, @Session, @Headers), DTO validation using class-validator, response control (@ResponseCode, @ResponseHeader), HTTP redirects, and an extensible annotation processor system for cross-cutting concerns like logging, authentication, and rate limiting. It supports both legacy and new annotation execution modes switchable via environment variable (USE_NEW_ANNOTATION_SYSTEM=1). Ships TypeScript types. Release cadence is irregular; actively maintained.
npm install dp-koa-framework-coreVerified import paths — ran on the pinned version, not inferred.
Shows minimal setup: import core decorators and utilities, define a controller with @Get and @Query, bind routes, and start Koa app.
Set process.env.USE_NEW_ANNOTATION_SYSTEM = '1' or call MigrationHelper.initializeNewSystem() if you intend to use processors (Logging, Permission, etc.).
Enable new system and test all decorators for compatibility. See MigrationHelper.
npm install class-validator class-transformer
Always use import { Get } from 'dp-koa-framework-core'.Use: return redirect(url, { status: 302 }); not return { data: redirect(...) }.npm install dp-koa-framework-core
Change require('dp-koa-framework-core').bindRouter to import { bindRouter } from 'dp-koa-framework-core'.Add @Transform((v) => Number(v)) and ensure class-validator and class-transformer are installed.