Skip to main content

sliceAnsi

Callable

  • sliceAnsi(text: string, start: number, end?: number): string

  • Slice a string while preserving ANSI escape codes. Based on slice-ansi.

    import { sliceAnsi } from '@boost/terminal';

    const text = sliceAnsi(aStringThatMayContainAnsi, 15, 25);