# linegauge/cli-truncate

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

Source: https://linegauge.interlace.tools/docs/api/cli-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 cliTruncate from 'linegauge/cli-truncate';
import type { Options } from 'linegauge/cli-truncate';
```

## Functions

### default

The default export, declared as `cliTruncate`.

Truncate `text` to `columns` terminal columns, as cli-truncate does.

```ts
function cliTruncate(text: string, columns: number, options?: Options): string;
```

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

**Returns** `string`

## Interfaces

### Options

cli-truncate's options.

```ts
interface Options {
    /** Which end loses characters. Default `'end'`. */
    readonly position?: 'start' | 'middle' | 'end';
    /** A space between the text and the mark. Default `false`. */
    readonly space?: boolean;
    /** Cut at a space within three columns of the break, when there is one. Default `false`. */
    readonly preferTruncationOnSpace?: boolean;
    /** The mark that says something was removed. Default `'…'`. */
    readonly truncationCharacter?: string;
}
```
