• Colorizes a JSON string or object.

    Parameters

    • json: string | object

      The JSON string or object to colorize.

    • Optionaloptions: {
          bigint?: string;
          comma?: string;
          false?: string;
          key?: string;
          leftCurlyBracket?: string;
          leftSquareBracket?: string;
          null?: string;
          number?: string;
          rightCurlyBracket?: string;
          rightSquareBracket?: string;
          string?: string;
          true?: string;
          undefined?: string;
      }

      The options for colorizing the JSON string.

      • Optionalbigint?: string

        The color to use for bigints.

      • Optionalcomma?: string

        The color to use for commas.

      • Optionalfalse?: string

        The color to use for false.

      • Optionalkey?: string

        The color to use for keys.

      • OptionalleftCurlyBracket?: string

        The color to use for left curly brackets.

      • OptionalleftSquareBracket?: string

        The color to use for left square brackets.

      • Optionalnull?: string

        The color to use for null.

      • Optionalnumber?: string

        The color to use for numbers.

      • OptionalrightCurlyBracket?: string

        The color to use for right curly brackets.

      • OptionalrightSquareBracket?: string

        The color to use for right square brackets.

      • Optionalstring?: string

        The color to use for strings.

      • Optionaltrue?: string

        The color to use for true.

      • Optionalundefined?: string

        The color to use for undefined.

    Returns string

    The colorized JSON string.

    enum options = {
    number = "§6",
    key = "§e",
    string = "§q",
    true = "§a",
    false = "§c",
    null = "§d",
    undefined = "§d"
    bigint = "§g",
    leftCurlyBracket = "§9",
    rightCurlyBracket = "§9",
    leftSquareBracket = "§5",
    rightSquareBracket = "§5",
    comma = "§f",
    }