xlsx-official
SolidGenerating Excel files with xlsx/exceljs in Node.js. Use when generating .xlsx reports, data exports, dashboards, or spreadsheets from database data.
Data & Documents 30 stars
9 forks Updated 5 days ago MIT
Install
Quality Score: 82/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# Excel Generation
## Option A — ExcelJS (Feature-Rich)
```bash
npm install exceljs
npm install -D @types/node
```
```typescript
// lib/excel/report.excel.ts
import ExcelJS from 'exceljs'
export async function generateExcelReport(data: ReportData): Promise<Buffer> {
const workbook = new ExcelJS.Workbook()
workbook.creator = 'Full Stack HQ'
workbook.lastModifiedBy = 'system'
workbook.created = new Date()
workbook.modified = new Date()
const sheet = workbook.addWorksheet('Report', {
pageSetup: {
paperSize: 9, // A4
orientation: 'landscape',
fitToPage: true,
},
views: [{ state: 'frozen', xSplit: 0, ySplit: 1 }], // freeze header row
})
// ─── Column Definitions ───────────────────────────────────
sheet.columns = data.columns.map(col => ({
header: col.header,
key: col.key,
width: col.width ?? 20,
style: {
alignment: { horizontal: col.align ?? 'left', wrapText: false },
numFmt: col.format, // e.g. '#,##0.00', 'yyyy-mm-dd'
},
}))
// ─── Style the Header Row ─────────────────────────────────
const headerRow = sheet.getRow(1)
headerRow.eachCell(cell => {
cell.fill = {
type: 'pattern',
pattern: 'solid',
fgColor: { argb: 'FF2563EB' },
}
cell.font = {
name: 'Calibri',
size: 11,
bold: true,
color: { argb: 'FFFFFFFF' },
}
cell.border = {
bottom: { style: 'medium', color: { argb: 'FF1D4ED8' } },
...
Details
- Author
- sabahattink
- Repository
- sabahattink/antigravity-fullstack-hq
- Created
- 8 months ago
- Last Updated
- 5 days ago
- Language
- PowerShell
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
Data & Documents Solid
docx-official
Generating Word documents programmatically with docx library in Node.js. Use when generating .docx reports, contracts, invoices, or any structured Word document from data.
30 Updated 5 days ago
sabahattink Data & Documents Listed
-excelcsv
把数组/JSON 导出成带表头冻结、斑马纹、是/否的漂亮 Excel/CSV。适合运营报表、数据导出、日志归档。
0 Updated 2 months ago
shuangying0001-beep Data & Documents Featured
document-xlsx
Create/edit .xlsx spreadsheets with formulas, charts, and data validation. Use when asked to generate Excel reports, models, or exports.
89 Updated 3 days ago
vasilyu1983