consola icon indicating copy to clipboard operation
consola copied to clipboard

feat: implement table method (resolves #318)

Open JosephAnson opened this issue 8 months ago • 1 comments

This PR introduces a new table method, I chose to support the same api as the browser console.table(): https://developer.mozilla.org/en-US/docs/Web/API/console/table_static. The fancy styling is based around the same output as chrome.

Introduced additional settings for styling similar to the box in the fancy reporter and I've provided tests to try to cover all the possible scenarios.

Features:

  • Can now use .table(data),.table(data, options?), .table(data, columnFilters[], options?)
  • Supports custom column selection
  • Allows customization of border style, border color, header color, and cell padding.
  • Handles edge cases such as empty arrays/objects and primitive values gracefully.
  • Integrates both Fancy and Basic reporters for styled or plain output.

JosephAnson avatar May 02 '25 13:05 JosephAnson

no one review?

lake2 avatar Jun 15 '25 08:06 lake2