# formatStackTrace

`import { formatStackTrace } from "destack:error";`

Format a structured stack trace as diagnostic text.

```ds title="formatStackTrace"
export declare function formatStackTrace(trace: readonly StackFrame[]): ^string
```

[language/library/src/error/stack.ds:63](https://github.com/destack-sh/destack/blob/main/language/library/src/error/stack.ds#L63)
