# typestack/class-transformer

Decorator-based transformation, serialization, and deserialization between objects and classes.

Repository: https://github.com/typestack/class-transformer
Canonical: https://ross.abutalabs.com/products/class-transformer
Language: TypeScript
License: MIT
License Family: permissive
Topics: typescript, transformation, exposing-properties, exposing-getters
Last push: 2026-05-22T11:06:41+00:00

## Health v2 (maintenance only)
Score: 60/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 83, release rhythm 8, longevity 100
- inputs: {"age_days": 3858, "days_push": 103, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 7339, forks 527 (observed 2026-08-28T04:09:58.331226+00:00)

## What it is
class-transformer is a TypeScript/JavaScript library that transforms plain objects into class instances and back using decorators. It supports serialization, deserialization, exposing/skipping properties, versioning, and groups for controlling output.

## Use cases
- convert plain JSON objects into typed class instances
- serialize class instances to plain objects for API responses
- deserialize API payloads into class instances with nested types
- exclude or rename properties during serialization
- convert date strings into Date objects on deserialization
- expose getters and method return values in serialized output

## When to choose
- you use TypeScript classes and want type-safe instances from plain objects
- you need fine-grained control over which properties are serialized
- you work with nested object graphs and need automatic type conversion
- you want decorator-based transformation on both frontend and backend

## When to avoid
- you only need simple JSON.stringify/parse without class instances
- your project uses plain interfaces and types instead of classes
- you need schema validation rather than transformation (use class-validator or zod)
- you avoid experimental/legacy decorators in your build setup

## Facets
- artifact type: library
- maturity: stable
- function: serialization, middleware
- domain: developer-tools, web-development, backend, frontend
- platform: browser, cross-platform
- tags: typescript, decorators, deserialization, plain-objects, class-instances, data-transformation, nodejs

## Member repositories
- typestack/class-transformer (main) score 60

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:58.331226+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:38:28.139315+00:00, confidence not recorded.
  - readme: https://github.com/typestack/class-transformer (fetched 2026-08-28T04:09:58.331226+00:00, sha 42ede5631086)
  - registry_npm: https://registry.npmjs.org/class-transformer (fetched 2026-08-29T08:34:05.163281+00:00, sha 961ba48322dd)
- Data as of 2026-08-30T08:39:29.467469+00:00.
