tecfu/tty-table

Cross-platform terminal table (Windows, Linux, macOS). Can also run in the browser console and provide. MCP server gives your coding agent with a quick way to add text-wrapped ASCII tables to your README or other files.

What it solves

It provides a way to render data as formatted ASCII or Unicode tables in terminal environments, browser consoles, and via MCP servers, ensuring that text wraps and aligns correctly regardless of character width (such as emojis or East Asian characters).

How it works

The library uses a factory API to take header definitions and row data (either as arrays or objects) and render them into a table. It calculates column widths based on terminal display columns rather than simple string length, utilizing the breakword library to handle Unicode 18.0.0 East Asian Width and Emoji Presentation standards.

Who it’s for

  • Developers building CLI tools that need to display structured data.
  • Developers creating MCP servers to allow AI agents (like Claude or Cursor) to output formatted tables.
  • Web developers who want to render terminal-style tables in the browser console.

Highlights

  • MCP Server Support: Includes a built-in MCP server that exposes a render_table tool for AI agents.
  • Unicode Aware: Correctly measures display width for complex characters, ensuring tables don't break visually.
  • Flexible Input: Supports both array-based and object-based row data.
  • Multi-platform: Works in Node.js (v22+), the browser, and as a standalone CLI tool.
  • Streaming Support: Capable of rendering tables from streaming data.

Related

  • Project
  • Project
  • Project
  • Project
  • Project