📖 Guide Documents
Utilization Cases
NestJS

Nestia (opens in a new tab) is a set of helper libraries for NestJS, supporting below features:

  • @nestia/core: superfast decorators using typia
  • @nestia/sdk: evolved SDK and Swagger generators
  • @nestia/migrate: Swagger to NestJS
  • nestia: just CLI (command line interface) tool
import { Controller } from "@nestjs/common";
import { TypedBody, TypedRoute } from "@nestia/core";
 
import type { IBbsArticle } from "@bbs-api/structures/IBbsArticle";
 
@Controller("bbs/articles")
export class BbsArticlesController {
    /** 
     * Store a new content.
     * 
     * @param input Content to store
     * @returns Newly archived article
     */
    @TypedRoute.Post() // 200x faster and safer JSON.stringify()
    public async store(
        @TypedBody() input: IBbsArticle.IStore // 20,000x faster validator
    ): Promise<IBbsArticle>; 
        // do not need DTO class definition, 
        // just fine with interface
}

nestia-sdk-demo

  • Left: NestJS server code
  • Right: Client code using SDK