> ## Documentation Index
> Fetch the complete documentation index at: https://resq-dependabot-github-actions-github-actions-478e18be3d.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# StripAnsi

# Function: stripAnsi()

> **stripAnsi**(`text`): `string`

Defined in: [sanitize.ts:427](https://github.com/resq-software/npm/blob/fe2e20ae9db8398a0db1e3218edaabb3cf7004d6/packages/security/src/sanitize.ts#L427)

Strips ANSI escape codes from a string.
Useful for cleaning terminal output before logging to files.

## Parameters

### text

`string`

The text potentially containing ANSI codes.

## Returns

`string`

The text with ANSI codes removed.

## Example

```typescript theme={null}
stripAnsi('\x1b[31mRed text\x1b[0m'); // 'Red text'
```
