kyrie
    Preparing search index...

    Function log_from_string

    • Converts a JSON or JavaScript string to plain text without color formatting Convenience function that parses the string and outputs as plain text

      Parameters

      • str: string

        The string to convert to plain text (JSON or JavaScript literal)

      • Optionaloptions: Options

        Optional configuration for formatting

      Returns string

      Plain text string without any color formatting

      const json = '{"name": "Alice", "age": 30}';
      const text = log_from_string(json);
      console.log(text); // Outputs plain text: {name: "Alice", age: 30}
      const arr = '[1, 2, 3, "hello", true]';
      const text = log_from_string(arr);
      fs.writeFileSync('output.txt', text); // Save to file