⚠️ Warning: This project is not yet stable and may undergo significant changes before reaching version 1.0.0. We strongly advise against using it in production environments.
Office Open XML monorepo - generate .docx, .pptx, .xlsx files with JS/TS.
- @office-open/core - Shared OOXML infrastructure
- @office-open/xml - XML parsing/serialization (WIP)
- @office-open/docx - Generate .docx files with a declarative API
- @office-open/xlsx - Generate .xlsx files (WIP)
- @office-open/pptx - Generate .pptx files (WIP)
# Install with npm
$ npm install @office-open/docx
# Install with pnpm
$ pnpm add @office-open/docximport { Document, Paragraph, TextRun, Packer } from "@office-open/docx";
import { writeFileSync } from "node:fs";
const doc = new Document({
sections: [
{
children: [
new Paragraph({
children: [new TextRun({ text: "Hello World", bold: true })],
}),
],
},
],
});
const buffer = await Packer.toBuffer(doc);
writeFileSync("document.docx", buffer);- Node.js 18.x or higher
- pnpm 9.x or higher (recommended package manager)
- Git for version control
-
Clone the repository:
git clone https://github.com/DemoMacro/office-open.git cd office-open -
Install dependencies:
pnpm install
-
Development mode:
pnpm dev
-
Build all packages:
pnpm build
-
Test locally:
# Run tests pnpm test
pnpm dev # Development mode with watch
pnpm build # Build all packages
pnpm test # Run tests
pnpm check # Lint & formatWe welcome contributions! Here's how to get started:
-
Fork the repository on GitHub
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/office-open.git cd office-open -
Add upstream remote:
git remote add upstream https://github.com/DemoMacro/office-open.git
-
Install dependencies:
pnpm install
-
Development mode:
pnpm dev
- Code: Follow our project standards
- Test:
pnpm build && pnpm test - Commit: Use conventional commits (
feat:,fix:, etc.) - Push: Push to your fork
- Submit: Create a Pull Request to upstream repository
This project follows core principles:
- OOXML Compliance: Strict adherence to the ISO-IEC29500 OOXML specification
- Type Safety: Full TypeScript support with comprehensive types
- Declarative API: Simple, intuitive API for document generation
- Modular Design: Shared core infrastructure across DOCX, PPTX, XLSX
- Performance: Optimized for large documents and batch processing
- User Experience: Simple API with powerful configuration options
This project is licensed under the MIT License - see the LICENSE file for details.
Built with ❤️ by Demo Macro