Formatear JSON
json-prettyFormatea JSON con sangría de 2/4 espacios o tabulador, con opción de ordenar claves. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: minificar JSON eliminando espacios (json-minify). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Parses JSON text and re-serializes it with 2/4-space or tab indentation, optionally sorting object keys. When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: parsing JSON text and serializing it without whitespace (json-minify). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | Yes | JSON text (string; required). | |
| indent | No | Indent (optional; one of: 2, 4, tab; default "2"). | 2 |
| sort_keys | No | Sort keys recursively (boolean; optional; default false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | No | any JSON value |