Function stripAnsiCode

  • Remove ANSI escape codes from the string.

    Parameters

    • string: string

      Text to remove ANSI escape codes from

    Returns string

    Text without ANSI escape codes

    import { red, stripAnsiCode } from "@std/internal/styles";

    console.log(stripAnsiCode(red("Hello, world!"))); // Prints "Hello, world!"