Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
O

officegen

> 编程语言
Open source

Standalone Office Open XML files (Microsoft Office 2007 and later) generator for Word (docx), PowerPoint (pptx) and Excell (xlsx) in javascript. The output is a

2.7K stars0 likes1 views
WebsiteGitHub

About

Standalone Office Open XML files (Microsoft Office 2007 and later) generator for Word (docx), PowerPoint (pptx) and Excell (xlsx) in javascript. The output is a

officegen

Creating Office Open XML files (Word, Excel and Powerpoint) for Microsoft Office 2007 and later without external tools, just pure Javascript. officegen should work on any environment that supports Node.js including Linux, OSX and Windows. officegen also supporting PowerPoint native charts objects with embedded data.

  • Getting Started
    • Installation
    • Getting Started with PowerPoint
    • Getting Started with Word
    • Getting Started with Excel
  • Full documentation
  • Support
  • The source code
  • Credit
  • Contributors
  • Backers
  • Sponsors

Contributors:

This project exists thanks to all the people who contribute.

Getting Started:

Officegen features overview:

  • Generating Microsoft PowerPoint document (.pptx file):
    • Create PowerPoint document with one or more slides.
    • Support both PPT and PPS.
    • Can create native charts.
    • Add text blocks.
    • Add images.
    • Can declare fonts, alignment, colors and background.
    • You can rotate objects.
    • Support shapes: Ellipse, Rectangle, Line, Arrows, etc.
    • Support hidden slides.
    • Support automatic fields like date, time and current slide number.
    • Support speaker notes.
    • Support slide layouts.
  • Generating Microsoft Word document (.docx file):
    • Create Word document.
    • You can add one or more paragraphs to the document and you can set the fonts, colors, alignment, etc.
    • You can add images.
    • Support header and footer.
    • Support bookmarks and hyperlinks.
  • Generating Microsoft Excel document (.xlsx file):
    • Create Excel document with one or more sheets. Supporting cells with either numbers or strings.

Installation:

$ npm install officegen

Microsoft PowerPoint basic usage example:

…

Since that officegen is using node.js events you can also create a document directly into a http respons stream:

…

Where to go from here?

  • For more information please refer to the full documentation.
  • For some examples please click here.

Microsoft Word basic usage example:

…

Where to go from here?

  • For more information please refer to the full documentation.
  • For some examples please click here.

Microsoft Excel basic usage example:

…

Where to go from here?

  • For more information please refer to the full documentation.
  • For some examples please click here.

Support:

Examples:

  • make_pptx.js - Example how to create PowerPoint 2007 presentation and save it into file.
  • make_xlsx.js - Example how to create Excel 2007 sheet and save it into file.
  • make_docx.js - Example how to create Word 2007 document and save it into file.
  • pptx_server.js - Example HTTP server that generating a PowerPoint file with your name without using files on the server side.

The official officegen Google Group:

officegen Google Group

The officegen Slack team:

Slack

Plans for the next release:

Trello

:coffee: The source code:

The project structure:

  • office/index.js - The main file.
  • office/lib/ - All the sources should be here.
    • basicgen.js - The generic engine to build many type of document files. This module providing the basicgen plugins interface for all the document generator. Any document generator MUST use this plugins API.
    • docplug.js - The document generator plugins interface - optional engine to create plugins API for each document generator.
    • msofficegen.js - A template basicgen plugin to extend the default basicgen module with the common Microsoft Office stuff. All the Microsoft Office based document generators in this project are using this template plugin.
    • genpptx.js - A document generator (basicgen plugin) to create a PPTX/PPSX document.
    • genxlsx.js - A document generator (basicgen plugin) to create a XLSX document.
    • gendocx.js - A document generator (basicgen plugin) to create a DOCX document.
    • pptxplg-*.js - docplug based plugins for genpptx.js ONLY to implement Powerpoint based features.
    • docxplg-*.js - docplug based plugins for genpptx.js ONLY to implement Word based features.
    • xlsxplg-*.js - docplug based plugins for genpptx.js ONLY to implement Excel based features.
  • officegen/test/ - All the unit tests.
  • Gruntfile.js - Grunt scripts.

Code documentations:

To create the jsdoc documentation:

grunt jsdoc

External dependencies:

This project is using the following awesome libraries/utilities/services:

  • archiver
  • jszip
  • lodash
  • xmlbuilder

How to add new features:

The easiest way to add new features is by using the officegen internal plugins system.

Credit:

  • Created by Ziv Barber in 2013.
  • For creating zip streams i'm using 'archiver' by cmilhench, dbrockman, paulj originally inspired by Antoine van Wel's zipstream.

Contributors:

This project exists thanks to all the people who contribute.

Backers:

Thank you to all our backers! [Become a backer]

Sponsors:

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言