Serialization

Discover serialization in NestJS.

Transform the response in NestJS using serialization

Serialization is the process of transforming data objects into a format that can be sent over a network or stored persistently, such as converting data to JSON. In this lesson, we’ll explore how to use serialization to transform the response in NestJS.

Why do we need serialization?

One common use of serialization is to control the data sent in API responses to prevent sensitive data from leaking. For example, we have a password field in the UserEntity class.

Access this course and 1400+ top-rated courses and projects.