tabular-exporter
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "tabular-exporter" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-870d2160371a22cb4f0e01b983847e48c537e5c376a465f7c5e0e1001e79fed2. Verify the upstream source and version against https://skillhub.cn/skills/user_3ff3c268/tabular-exporter before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Export arrays of records to styled Excel (xlsx) or BOM-prefixed CSV, supporting column configuration (header/width/order), frozen header row, zebra striping, boolean to “Yes/No” conversion, array line breaks, and CSV Chinese encoding protection, implemented with zero dependencies. Example trigger terms: export Excel, export CSV, records to table, column-config export, data export, table styling, JSON to table.
Introduction source: third_party · user_3ff3c268 · 1.2.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: tabular-exporter
display_name: 记录数据一键导出 Excel/CSV(带样式)
description: 把记录数组导出为带样式的 Excel(xlsx) 或带 BOM 的 CSV。支持列配置(表头/宽度/顺序)、表头冻结首行、斑马纹、布尔值转「是/否」、数组换行、CSV 中文防乱码。零依赖。触发词:导出 Excel、导出 CSV、记录转表格、列配置导出、数据导出、表格美化、JSON 转表格。
market_desc: 把记录数组导出为带样式的 Excel(xlsx) 或带 BOM 的 CSV。支持列配置(表头/宽度/顺序)、表头冻结首行、斑马纹、布尔转是/否、数组换行、CSV 中文防乱码。零依赖,适合运营报表、数据导出、日志归档。 【闭环归属】本技能是「API/数据接入管线闭环」的第 5 步(共 5 步:解析→对齐→合并→换算→导出)。要可交付的数据资产,配齐这 5 个技能即可;总控入口:api-data-pipeline。
version: 1.2.0
changelog: 升级 v1.2.0:中性化署名、场景拓宽、补充闭环归属交叉引用。
tabular-exporter —— 记录数组导出为表格
把任意「数组 of 对象」变成带样式的 Excel 或带 BOM 的 CSV。 零依赖:xlsx 由纯 JS 生成(ZIP STORE 法,内置 CRC32),CSV 自带 UTF-8 BOM。无需
npm install任何包。
适用场景
- 把采集 / 接口返回的结构化数据导出成可交付的 Excel / CSV
- 后台「导出」功能、数据报表、数据迁移
- 需要中文不乱码、带表头样式、冻结首行
提供的函数
| 函数 | 说明 |
|---|---|
exportToExcel(rows, columns, opts?) |
生成带样式 xlsx(Buffer),可选落盘 filePath |
exportToCsv(rows, columns, opts?) |
生成带 BOM 的 CSV 字符串 |
exportTable(rows, columns, opts?) |
统一入口,opts.format = 'xlsx' \| 'csv' |
columnsFromKeys(keys, widths?) |
由 key 列表快速生成列配置 |
columns 形如 [{ key, header?, width? }],rows 为对象数组。
样式特性:
- 表头:加粗 + 白字 + 蓝底(
4472C4) - 冻结首行
- 斑马纹(偶数行浅灰底)
- 布尔值 →
是/否;数组 → 换行;对象 → JSON - xlsx 与 Excel / WPS / LibreOffice 兼容(标准 OOXML)
用法
import { exportTable, columnsFromKeys } from './scripts/exporter.mjs';
const rows = [
{ title: '无线鼠标', price: 99.5, inStock: true },
{ title: '机械键盘', price: 299, inStock: false },
];
const columns = [
{ key: 'title', header: '标题', width: 40 },
{ key: 'price', header: '价格', width: 12 },
{ key: 'inStock', header: '有货', width: 8 },
];
// 导出 xlsx(直接落盘)
exportTable(rows, columns, { format: 'xlsx', filePath: 'out.xlsx', sheetName: '商品' });
// 导出 csv(返回字符串)
const csv = exportTable(rows, columns, { format: 'csv' });
自测
node scripts/exporter.mjs --selftestCurrent listing version
1.2.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 高价值数据导出工具,解决结构化数据交付痛点
- 支持 Excel 样式、CSV 中文防乱码等生产级特性
- 零依赖实现,适用运营报表、数据迁移等高频场景
Highlights
- 触发词覆盖全面:导出 Excel/CSV、记录转表格、列配置等
- 边界清晰,无歧义表达
Highlights
- 结构完整:场景→函数→用法→自测闭环
- frontmatter 信息齐全,含版本与变更日志
- 提供端到端代码示例
Highlights
- 纯 JS 零依赖实现,无需 npm install
- 覆盖布尔值、数组、对象等数据类型转换
- CSV 带 BOM 防中文乱码,Excel 兼容主流软件
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 18
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.