πŸ“„ File detail

ink/wrapAnsi.ts

🧩 .tsπŸ“ 21 linesπŸ’Ύ 383 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œink/”, which covers Ink terminal UI (layouts, TTY IO, keyboard, renderer components). On the API surface it exposes wrapAnsi β€” mainly functions, hooks, or classes. Dependencies touch wrap-ansi.

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

import wrapAnsiNpm from 'wrap-ansi' type WrapAnsiOptions = { hard?: boolean wordWrap?: boolean

πŸ“€ Exports (heuristic)

  • wrapAnsi

πŸ“š External import roots

Package roots from from "…" (relative paths omitted).

  • wrap-ansi

πŸ–₯️ Source preview

import wrapAnsiNpm from 'wrap-ansi'

type WrapAnsiOptions = {
  hard?: boolean
  wordWrap?: boolean
  trim?: boolean
}

const wrapAnsiBun =
  typeof Bun !== 'undefined' && typeof Bun.wrapAnsi === 'function'
    ? Bun.wrapAnsi
    : null

const wrapAnsi: (
  input: string,
  columns: number,
  options?: WrapAnsiOptions,
) => string = wrapAnsiBun ?? wrapAnsiNpm

export { wrapAnsi }