MCPInstall

exceljs

在Node.js中读取、操作和写入Excel电子表格(XLSX)。完全支持样式、公式、图表和大文件流式处理。

Installs
185
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/aidotnet/moyucode --skill exceljs
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads exceljs automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

ExcelJS Tool

Description

Read, manipulate, and write Excel spreadsheets with full formatting support.

Source

Installation

npm install exceljs

Usage Examples

Create Excel File

import ExcelJS from 'exceljs';

async function createReport() {
  const workbook = new ExcelJS.Workbook();
  workbook.creator = 'My App';
  workbook.created = new Date();
  
  const sheet = workbook.addWorksheet('Sales Report');
  
  // Define columns
  sheet.columns = [
    { header: 'ID', key: 'id', width: 10 },
    { header: 'Product', key: 'product', width: 30 },
    { header: 'Quantity', key: 'quantity', width: 15 },
    { header: 'Price', key: 'price', width: 15 },
    { header: 'Total', key: 'total', width: 15 },
  ];
  
  // Add data
  const data = [
    { id: 1, product: 'Widget A', quantity: 100, price: 9.99 },
    { id: 2, product: 'Widget B', quantity: 50, price: 19.99 },
    { id: 3, product: 'Widget C', quantity: 75, price: 14.99 },
  ];
  
  data.forEach(item => {
    sheet.addRow({
      ...item,
      total: { formula: `C${sheet.rowCount + 1}*D${sheet.rowCount + 1}` },
    });
  });
  
  await workbook.xlsx.writeFile('report.xlsx');
}

Style Cells

async function createStyledReport() {
  const workbook = new ExcelJS.Workbook();
  const sheet = workbook.addWorksheet('Styled');
  
  // Header row with styling
  const headerRow = sheet.addRow(['Name', 'Email', 'Status']);
  headerRow.eachCell(cell => {
    cell.fill = {
      type: 'pattern',
      pattern: 'solid',
      fgColor: { argb: '4F46E5' },
    };
    cell.font = { color: { argb: 'FFFFFF' }, bold: true };
    cell.alignment = { horizontal: 'center' };
    cell.border = {
      top: { style: 'thin' },
      bottom: { style: 'thin' },
    };
  });
  
  // Data rows
  const users = [
    { name: 'John', email: 'john@example.com', status: 'Active' },
    { name: 'Jane', email: 'jane@example.com', status: 'Inactive' },
  ];
  
  users.forEach(user => {
    const row = sheet.addRow([user.name, user.email, user.status]);
    
    // Conditional formatting
    const statusCell = row.getCell(3);
    statusCell.fill = {
      type: 'pattern',
      pattern: 'solid',
      fgColor: { argb: user.status === 'Active' ? '22C55E' : 'EF4444' },
    };
  });
  
  await workbook.xlsx.writeFile('styled-report.xlsx');
}

Read Excel File

async function readExcel(filePath: string) {
  const workbook = new ExcelJS.Workbook();
  await workbook.xlsx.readFile(filePath);
  
  const sheet = workbook.getWorksheet('Sheet1');
  const data: any[] = [];
  
  sheet?.eachRow((row, rowNumber) => {
    if (rowNumber === 1) return; // Skip header
    
    data.push({
      id: row.getCell(1).value,
      name: row.getCell(2).value,
      email: row.getCell(3).value,
    });
  });
  
  return data;
}

Stream Large Files

async function streamLargeExcel(data: any[], outputPath: string) {
  const workbook = new ExcelJS.stream.xlsx.WorkbookWriter({
    filename: outputPath,
    useStyles: true,
  });
  
  const sheet = workbook.addWorksheet('Data');
  sheet.columns = [
    { header: 'ID', key: 'id' },
    { header: 'Value', key: 'value' },
  ];
  
  // Stream rows (memory efficient)
  for (const item of data) {
    sheet.addRow(item).commit();
  }
  
  await workbook.commit();
}

Tags

excel, spreadsheet, xlsx, report, data-export

Compatibility

  • Codex: ✅
  • Claude Code: ✅

FAQ

What does the exceljs skill do?

在Node.js中读取、操作和写入Excel电子表格(XLSX)。完全支持样式、公式、图表和大文件流式处理。

How do I install exceljs?

Run npx skills add https://github.com/aidotnet/moyucode --skill exceljs in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/exceljs/ (personal) or .claude/skills/exceljs/ (project).

Which AI agents can use exceljs?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is exceljs safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains exceljs?

It is published by aidotnet in aidotnet/moyucode. It has 185 recorded installs.

More from aidotnet/moyucode

View all →

bilibili-analyzer

aidotnet/moyucode

自动分析B站视频内容,下载视频并拆解成帧图片,使用AI分析并生成详细的专题文档或实操教程。

1.1K installs

cron-scheduler

aidotnet/moyucode

Open the skill to read its SKILL.md instructions.

177 installs

puppeteer

aidotnet/moyucode

Open the skill to read its SKILL.md instructions.

125 installs

clipboard-manager

aidotnet/moyucode

Open the skill to read its SKILL.md instructions.

100 installs

nodemailer

aidotnet/moyucode

Open the skill to read its SKILL.md instructions.

95 installs

excel-handler

aidotnet/moyucode

读取、写入和操作Excel文件(.xlsx、.xls)。创建电子表格、读取数据并导出为各种格式。

Data & Databases60 installs

Popular data & databases skills

View category →

Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.

OfficialData & Databases462.2K installs

prisma-client-api

prisma/skills

Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".

OfficialData & Databases393.5K installs

Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.

OfficialData & Databases392.3K installs

prisma-cli

prisma/skills

Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.

OfficialData & Databases390.8K installs

prisma-postgres

prisma/skills

Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.

OfficialData & Databases384.4K installs

Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.

OfficialData & Databases378.9K installs