---
meta:
 - name: keywords
   description: api typescript node.js documentation serialize function
---
# serialize - @tsed/json-mapper

## Usage

```typescript
import { serialize } from "@tsed/json-mapper";
```

> See [/packages/specs/json-mapper/src/utils/serialize.ts](https://github.com/tsedio/tsed/blob/v8.28.5/packages/specs/json-mapper/src/utils/serialize.ts#L0-L0).

## Overview

```ts
function serialize(input: any, options?: JsonSerializerOptions): any;
```

<!-- Description -->

## Description

Serialize any value using the shared `JsonSerializer` instance.
Respects schema metadata, hooks, aliases, and registered custom mappers.

### Example

```ts
import {serialize} from "@tsed/json-mapper";

const payload = serialize(model, {type: UserModel, useAlias: true});
```
