lily
    Preparing search index...

    Function stripColours

    • removes all ansi colour codes from a string.

      Parameters

      • text: string

        the text to strip colours from

      Returns string

      the text with all ansi escape sequences removed

      const plainText = stripColours('\x1b[31mred text\x1b[0m');
      console.log(plainText); // "red text"