Skip to content

prettyPrint

prettyPrint(string, indent?) → string · Format

Auto-detect format and pretty-print a string (JSON, XML, or YAML).

  • string (required): the string to format

  • indent (optional): indentation size

utlx
prettyPrint($input.compactJson)          // auto-detects JSON and formats

Released under AGPL-3.0.