kyrie
    Preparing search index...

    Function ansi_from_value

    • Converts a JavaScript value to ANSI-colored terminal output Convenience function that parses the value and paints it with ANSI codes

      Parameters

      • value: unknown

        The value to convert to ANSI output

      • Optionaloptions: Options

        Optional configuration for highlighting

      Returns string

      String with ANSI color codes for terminal display

      const data = { name: "Alice", age: 30 };
      const ansi = ansi_from_value(data);
      console.log(ansi); // Outputs colorized in terminal
      const arr = [1, 2, 3, "hello", true];
      const ansi = ansi_from_value(arr, { palette: palettes.bold.dark });
      console.log(ansi); // Outputs with ANSI color codes