nx/docs/generated/devkit/serializeJson.md
2023-12-13 16:49:46 +01:00

26 lines
975 B
Markdown

# Function: serializeJson
**serializeJson**\<`T`\>(`input`, `options?`): `string`
Serializes the given data to a JSON string.
By default the JSON string is formatted with a 2 space indentation to be easy readable.
#### Type parameters
| Name | Type |
| :--- | :-------------------------- |
| `T` | extends `object` = `object` |
#### Parameters
| Name | Type | Description |
| :--------- | :-------------------------------------------------------------------- | :---------------------------------------- |
| `input` | `T` | Object which should be serialized to JSON |
| `options?` | [`JsonSerializeOptions`](../../devkit/documents/JsonSerializeOptions) | JSON serialize options |
#### Returns
`string`
the formatted JSON representation of the object