• Version 8.0.1
  • Published
  • 4.89 kB
  • No dependencies
  • MIT license


npm i @types/wrap-ansi
yarn add @types/wrap-ansi
pnpm add @types/wrap-ansi


TypeScript definitions for wrap-ansi





function wrapAnsi

wrapAnsi: (input: string, columns: number, options?: wrapAnsi.Options) => string;
  • Wrap words to the specified column width.

    Parameter input

    String with ANSI escape codes. Like one styled by chalk.

    Parameter columns

    Number of columns to wrap the text to.

    Parameter options

    By default the wrap is soft, meaning long words may extend past the column width. Setting this to true will make it hard wrap at the column width.


namespace wrapAnsi

namespace wrapAnsi {}

    interface Options

    interface Options {}

      property hard

      hard?: boolean | undefined;
      • false

      property trim

      trim?: boolean | undefined;
      • true

      property wordWrap

      wordWrap?: boolean | undefined;
      • true

      Package Files (1)

      Dependencies (0)

      No dependencies.

      Dev Dependencies (0)

      No dev dependencies.

      Peer Dependencies (0)

      No peer dependencies.


      To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

      You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/wrap-ansi.

      • Markdown
      • HTML
        <a href="https://www.jsdocs.io/package/@types/wrap-ansi"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>