Skip to content

Modern TypeScript Excel Workbook Manager - Read, manipulate and write spreadsheet data and styles to XLSX and JSON.

License

Notifications You must be signed in to change notification settings

cjnoname/excelts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExcelTS

Build Status

Modern TypeScript Excel Workbook Manager - Read, manipulate and write spreadsheet data and styles to XLSX and JSON.

About This Project

ExcelTS is a modernized fork of ExcelJS with:

  • Full TypeScript Support - Complete type definitions and modern TypeScript patterns
  • Updated Dependencies - All dependencies upgraded to latest stable versions
  • Modern Build System - Using Rolldown for faster builds
  • Enhanced Testing - Migrated to Vitest with browser testing support
  • ESM First - Native ES Module support with CommonJS compatibility
  • Node 20+ - Optimized for modern Node.js versions
  • Named Exports - All exports are named for better tree-shaking

Translations

Installation

npm install @cj-tech-master/excelts

## Quick Start

### Creating a Workbook

```javascript
import { Workbook } from "@cj-tech-master/excelts";

const workbook = new Workbook();
const sheet = workbook.addWorksheet("My Sheet");

// Add data
sheet.addRow(["Name", "Age", "Email"]);
sheet.addRow(["John Doe", 30, "[email protected]"]);
sheet.addRow(["Jane Smith", 25, "[email protected]"]);

// Save to file
await workbook.xlsx.writeFile("output.xlsx");

Reading a Workbook

import { Workbook } from "@cj-tech-master/excelts";

const workbook = new Workbook();
await workbook.xlsx.readFile("input.xlsx");

const worksheet = workbook.getWorksheet(1);
worksheet.eachRow((row, rowNumber) => {
  console.log("Row " + rowNumber + " = " + JSON.stringify(row.values));
});

Styling Cells

// Set cell value and style
const cell = worksheet.getCell("A1");
cell.value = "Hello";
cell.font = {
  name: "Arial",
  size: 16,
  bold: true,
  color: { argb: "FFFF0000" }
};
cell.fill = {
  type: "pattern",
  pattern: "solid",
  fgColor: { argb: "FFFFFF00" }
};

Features

  • Excel Operations

    • Create, read, and modify XLSX files
    • Multiple worksheet support
    • Cell styling (fonts, colors, borders, fills)
    • Cell merging and formatting
    • Row and column properties
    • Freeze panes and split views
  • Data Handling

    • Rich text support
    • Formulas and calculated values
    • Data validation
    • Conditional formatting
    • Images and charts
    • Hyperlinks
    • Pivot tables
  • Advanced Features

    • Streaming for large files
    • CSV import/export
    • Tables with auto-filters
    • Page setup and printing options
    • Data protection
    • Comments and notes

Browser Support

ExcelTS supports both Node.js and browser environments:

// Browser usage
import { Workbook } from "@cj-tech-master/excelts/browser";

const workbook = new Workbook();
// ... use workbook API

Requirements

Node.js

  • Node.js >= 18.0.0 (ES2020 native support)
  • Recommended: Node.js >= 20.0.0 for best performance

Browsers (No Polyfills Required)

  • Chrome >= 85 (August 2020)
  • Edge >= 85 (August 2020)
  • Firefox >= 79 (July 2020)
  • Safari >= 14 (September 2020)
  • Opera >= 71 (September 2020)

All ES2020 features (optional chaining ?., nullish coalescing ??, Promise.allSettled, etc.) are natively supported in these versions.

Maintainer

This project is actively maintained by CJ (@cjnoname).

Maintenance Status

Active Maintenance - This project is actively maintained with a focus on:

  • 🔒 Security Updates - Timely security patches and dependency updates
  • 🐛 Bug Fixes - Critical bug fixes and stability improvements
  • 📦 Dependency Management - Keeping dependencies up-to-date and secure
  • 🔍 Code Review - Reviewing and merging community contributions

Contributing

While I may not have the bandwidth to develop new features regularly, community contributions are highly valued and encouraged!

  • 💡 Pull Requests Welcome - I will review and merge quality PRs promptly
  • 🚀 Feature Proposals - Open an issue to discuss new features before implementing
  • 🐛 Bug Reports - Please report bugs with reproducible examples
  • 📖 Documentation - Improvements to documentation are always appreciated

API Documentation

For detailed API documentation, please refer to the comprehensive documentation sections:

  • Workbook Management
  • Worksheets
  • Cells and Values
  • Styling
  • Formulas
  • Data Validation
  • Conditional Formatting
  • File I/O

The API remains largely compatible with the original ExcelJS.

Contributing Guidelines

Contributions are welcome! Please feel free to submit a Pull Request.

Before Submitting a PR

  1. Bug Fixes: Add a unit-test or integration-test (in the src/__test__ folder) that reproduces the issue
  2. New Features: Open an issue first to discuss the feature and implementation approach
  3. Documentation: Update relevant documentation and type definitions
  4. Code Style: Follow the existing code style and pass all linters (npm run lint)
  5. Tests: Ensure all tests pass (npm test) and add tests for new functionality

Important Notes

  • Version Numbers: Please do not modify package version in PRs. Versions are managed through releases.
  • License: All contributions will be included under the project's MIT license
  • Commit Messages: Write clear, descriptive commit messages

Getting Help

If you need help or have questions:

License

MIT License

Based on ExcelJS by Guyon Roche

Credits

This project is a fork of ExcelJS with modernization improvements. All credit for the original implementation goes to:

Links

Changelog

See CHANGELOG.md for detailed version history.

1.0.0 (2025-10-30)

🎉 First Stable Release - ExcelTS is now production-ready!

  • Full TypeScript rewrite with strict typing
  • All default exports converted to named exports
  • Updated all dependencies to latest versions
  • Migrated to Vitest for testing
  • Switched to Rolldown for bundling
  • Modern ES Module support
  • Node 18+ support
  • Enhanced type safety with proper access modifiers
  • Browser testing support
  • Performance optimizations

About

Modern TypeScript Excel Workbook Manager - Read, manipulate and write spreadsheet data and styles to XLSX and JSON.

Resources

License

Stars

Watchers

Forks

Packages

No packages published