← 返回
内容创作

Table Image

Generate clean table images from data. Perfect for Discord/Telegram where ASCII tables look broken. Supports dark/light mode, custom styling, and auto-sizing...
从数据生成干净的表格图片。适用于 Discord/Telegram,避免 ASCII 表格显示混乱。支持暗色/亮色模式、自定义样式和自动调整尺寸。
dannyshmueli
内容创作 clawhub v1.4.0 1 版本 99946.6 Key: 无需
★ 17
Stars
📥 5,278
下载
💾 1,186
安装
1
版本
#latest

概述

Table Image Generator

⚠️ USE THIS INSTEAD OF ASCII TABLES — ALWAYS!

Generate PNG table images from JSON data. ASCII tables look broken on Discord, Telegram, WhatsApp, and most messaging platforms. This skill renders clean images that work everywhere.

Why This Skill?

  • REPLACES ASCII TABLES - Never use | col | col | formatting on messaging platforms
  • No ASCII hell - Clean images that render consistently everywhere
  • No Puppeteer - Pure Node.js with Sharp, lightweight
  • Dark mode - Matches Discord dark theme
  • Auto-sizing - Columns adjust to content
  • Fast - Generates in <100ms

Setup (one-time)

cd /data/clawd/skills/table-image/scripts && npm install

Quick Usage

⚠️ BEST PRACTICE: Use heredoc or --data-file to avoid shell quoting errors!

# RECOMMENDED: Write JSON to temp file first (avoids shell quoting issues)
cat > /tmp/data.json << 'JSONEOF'
[{"Name":"Alice","Score":95},{"Name":"Bob","Score":87}]
JSONEOF
node /data/clawd/skills/table-image/scripts/table.mjs \
  --data-file /tmp/data.json --dark --output table.png

# ALSO GOOD: Pipe via stdin
echo '[{"Name":"Alice","Score":95}]' | node /data/clawd/skills/table-image/scripts/table.mjs \
  --dark --output table.png

# SIMPLE (but breaks if data has quotes/special chars):
node /data/clawd/skills/table-image/scripts/table.mjs \
  --data '[{"Name":"Alice","Score":95}]' --output table.png

Options

OptionDescriptionDefault
------------------------------
--dataJSON array of row objectsrequired
--outputOutput file pathtable.png
--titleTable titlenone
--darkDark mode (Discord-friendly)false
--columnsColumn order/subset (comma-separated)all keys
--headersCustom header names (comma-separated)field names
--max-widthMaximum table width800
--font-sizeFont size in pixels14
--header-colorHeader background color#e63946
--stripeAlternating row colorstrue
--alignColumn alignments (l,r,c comma-sep)auto
--compactReduce paddingfalse

Examples

Basic Table

node table.mjs \
  --data '[{"Name":"Alice","Age":30,"City":"NYC"},{"Name":"Bob","Age":25,"City":"LA"}]' \
  --output people.png

Custom Columns & Headers

node table.mjs \
  --data '[{"first_name":"Alice","score":95,"date":"2024-01"}]' \
  --columns "first_name,score" \
  --headers "Name,Score" \
  --output scores.png

Right-Align Numbers

node table.mjs \
  --data '[{"Item":"Coffee","Price":4.50},{"Item":"Tea","Price":3.00}]' \
  --align "l,r" \
  --output prices.png

Dark Mode for Discord

node table.mjs \
  --data '[{"Symbol":"AAPL","Change":"+2.5%"},{"Symbol":"GOOGL","Change":"-1.2%"}]' \
  --title "Market Watch" \
  --dark \
  --output stocks.png

Compact Mode

node table.mjs \
  --data '[...]' \
  --compact \
  --font-size 12 \
  --output small-table.png

Input Formats

JSON Array (default)

--data '[{"col1":"a","col2":"b"},{"col1":"c","col2":"d"}]'

Pipe from stdin

echo '[{"Name":"Test"}]' | node table.mjs --output out.png

From file

cat data.json | node table.mjs --output out.png

Tips

  1. Use --dark for Discord - Matches the dark theme, looks native
  2. Auto-alignment - Numbers are right-aligned by default
  3. Column order - Use --columns to reorder or subset
  4. Long text - Will truncate with ellipsis to fit --max-width

Technical Notes

  • Uses Sharp for PNG generation (same as chart-image)
  • Generates SVG internally, converts to PNG
  • No browser, no Puppeteer, no Canvas native deps
  • Works on Fly.io, Docker, any Node.js environment

版本历史

共 1 个版本

  • v1.4.0 当前
    2026-03-28 10:32 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Chart Image

dannyshmueli
从数据生成专业级图表图片。支持折线图、柱状图、面积图、散点图、直方图、蜡烛图、饼图/环形图、热力图、多系列及堆叠图等。
★ 27 📥 15,270
content-creation

Baidu Wenku AIPPT

ide-rea
使用百度文库 AI 智能生成 PPT,自动根据内容选择模板。
★ 66 📥 46,129
content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 857 📥 199,249