JSON a CSV
csv-buildConvierte un arreglo de objetos en CSV (RFC 4180); columnas = unión de claves; puede neutralizar fórmulas de hoja de cálculo. Cuándo: hay que transformar, comparar o revisar con exactitud datos estructurados (JSON, CSV, YAML, XML, arreglos). No para: convertir CSV (csv-parse). 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: Converts an array of objects (or arrays) to RFC 4180 CSV; columns are the union of keys in first-seen order, nested values are JSON-encoded, and spreadsheet formula prefixes can be neutralized. When: structured data (JSON, CSV, YAML, XML, arrays) has to be transformed, compared or checked exactly. Not for: parsing RFC 4180 CSV (csv-parse). 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 |
|---|---|---|---|
| data | Yes | Rows (array; required). | |
| columns | No | Explicit column order (array of string; optional; up to 1000 items). | |
| delimiter | No | Delimiter (optional; one of: ,, ;, , |; default ","). | , |
| line_ending | No | Line ending (optional; one of: , ; default "\n"). | |
| escape_formulas | No | Prefix cells starting with = + - @ with ' (boolean; optional; default false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| csv | No |