npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ts-deco

v1.0.36

Published

TypeScript decorator utilities for Node.js with strict validation standards

Readme

ts-deco

검증과 Swagger 작성을 동시에 처리하는 함축적인 데코레이터 라이브러리

TypeScript decorator utilities with strict validation standards and automatic Swagger documentation

하나의 데코레이터로 타입 검증과 Swagger API 문서화를 동시에 처리하는 Node.js/TypeScript용 DTO 데코레이터 라이브러리입니다.
NestJSNode.js (Express, Fastify 등) 모든 프로젝트에서 사용할 수 있습니다.


설치

npm install ts-deco

빠른 시작

DTO 검증 + Swagger 문서화

Property 데코레이터 하나로 타입 검증과 Swagger 문서 작성을 동시에 처리할 수 있습니다:

import { Property } from "ts-deco";

class CreateUserDto {
  @Property({
    type: String,
    optional: false,
    description: "사용자 이름",
    example: "홍길동",
  })
  name: string;

  @Property({ type: Number, min: 0, max: 120, optional: false })
  age: number;
}

Controller Swagger 문서화

ResourceEndpoint로 Controller 문서화를 한 번에 처리할 수 있습니다:

import { Resource, Endpoint } from "ts-deco";

@Resource("Users", "/api/users")
export class UserController {
  @Endpoint({
    method: "POST",
    summary: "사용자 생성",
    tags: ["Users"],
    body: { type: CreateUserDto, required: true },
    responses: [
      { status: 201, description: "생성 성공" },
      { status: 400, description: "Validation 실패" },
    ],
  })
  @Post()
  create(@Body() dto: CreateUserDto) {}
}

주요 기능

  • 함축적: 하나의 데코레이터로 검증과 Swagger 문서화 동시 처리
  • 간결함: 코드 중복 제거, 가독성 향상
  • 타입 안전성: 엄격한 타입 체크로 컴파일 타임 에러 방지
  • 자동 문서화: Swagger API 문서 자동 생성
  • 호환성: NestJS와 Node.js (Express, Fastify 등) 모두 지원
  • 런타임 안정성: 명확한 에러 메시지 제공

문서

| 문서 | 내용 | | --------------------------------------------- | ------------------------------------------------------------ | | Property 데코레이터 | Property 데코레이터 사용법, 옵션 레퍼런스, 검증 동작 방식 | | 개별 데코레이터 | DtoString, DtoNumber, DtoDate, DtoBoolean, DtoEnum | | Controller 데코레이터 | Resource, Endpoint, DocTags, DocOperation 등 | | 사용 예제 | NestJS, Express 전체 예제 | | 설치 및 환경 | 의존성, 지원 환경, tsconfig 설정 |


라이선스

ISC License