# linegauge/truncate

> Every export of linegauge/truncate, with its signature and doc comment: truncate, plus 1 type.

Source: https://linegauge.interlace.tools/docs/api/truncate

<!-- Generated by scripts/api-reference.ts from the built dist/*.d.ts. Do not edit; run `npx tsx scripts/api-reference.ts`. -->

```ts
import { truncate } from 'linegauge/truncate';
```

## Functions

### truncate

```ts
function truncate(string: string, columns: number, options?: TruncateOptions): string;
```

| Parameter | Type |
| :-- | :-- |
| `string` | `string` |
| `columns` | `number` |
| `options` (optional) | `TruncateOptions` |

**Returns** `string`

## Interfaces

### TruncateOptions

```ts
interface TruncateOptions {
    /** Which end loses characters. Default `'end'`. */
    position?: 'start' | 'middle' | 'end';
    /** The mark that says something was removed. Measured, not assumed. Default `'\u2026'`. */
    ellipsis?: string;
}
```
