Set of tools for converting JSON data into tables (HTML, XLSX, ASCII).
npm install @json-table/coreimport { makeBlockFactory } from "@json-table/core/json-to-table";
import { blockToASCII } from "@json-table/core/block-to-ascii";
import { blockToHTML } from '@json-table/core/block-to-html';
const createBlock = makeBlockFactory({
  cornerCellValue: "№",
  joinPrimitiveArrayValues: true,
});
const block = createBlock(data)
const asciiTable = blockToASCII(block);
/* Or */
const htmlTable = blockToHTML(block);Tip
See block-to-html source code to create your own renderer
Input data:
{
  "key": "val",
  "primitiveArr": [1, "two", false],
  "object": {
    "key1": "value1",
    "key2": 789,
    "key3": {
      "nestedKey": "nestedVal"
    }
  },
  "nestedArray": [
    {
      "name": "John",
      "age": 30,
      "isStud": false
    },
    {
      "name": "Alice",
      "age": 25,
      "isStud": true
    }
  ]
}
Output:
+-----+---------------+---------------------------+--------------------------+
| key | primitiveArr  |          object           |         nestedArray      |
+-----+---------------+--------+------+-----------+---+-------+-----+--------+
|     |               |  key1  | key2 |   key3    | № | name  | age | isStud |
|     |               +--------+------+-----------+---+-------+-----+--------+
| val | 1, two, false |        |      | nestedKey | 1 | John  |  30 | false  |
|     |               | value1 |  789 +-----------+---+-------+-----+--------+
|     |               |        |      | nestedVal | 2 | Alice |  25 | true   |
+-----+---------------+--------+------+-----------+---+-------+-----+--------+
MIT