lily
    Preparing search index...

    Function colourize

    • wraps text with ansi colour codes and automatically resets at the end.

      Parameters

      • text: string

        the text to colourize

      • colour: string

        the ansi colour code to apply

      Returns string

      the colourized text with reset code appended

      const redText = colourize('error', COLOURS.FG_RED);
      console.log(redText); // prints "error" in red