PowerPoint decks generated from JavaScript, in or out of the browser
PptxGenJS writes PowerPoint presentations from JavaScript or TypeScript code. A deck takes four steps: create the presentation, add a slide, place objects on it (text, tables, shapes, images, media, charts), then save. The result is a standard OOXML file that PowerPoint, Keynote and LibreOffice Impress open and Google Slides imports, with no Office install anywhere in the chain. The library runs in the browser, on Node.js, in a Web Worker, inside Electron, or in serverless functions such as AWS Lambda.
Charts that stay editable, masters defined in code
- Native charts: ten types (area, bar, 3D bar, bubble, 3D bubble, doughnut, line, pie, radar, scatter), plus combo charts with an optional secondary axis. Every chart ships with its own embedded Excel workbook, so its data can be edited later from PowerPoint.
- Slide masters:
defineSlideMaster()sets the background, margins, recurring objects such as a logo, slide numbers, and placeholders for a title, body, image, chart, table or media. Each master becomes a real layout in the file, which can still be adjusted in PowerPoint's Slide Master view. - HTML tables split across slides:
tableToSlides()takes a<table>from the page and spreads it over as many slides as it needs, optionally repeating the header row. CSS is only read at cell level, and a nested table keeps its text only. - Output formats:
writeFile()triggers a download in the browser or writes to disk on Node.js.write()returns base64, a Blob, an ArrayBuffer, a Uint8Array or a Node Buffer, andstream()feeds an HTTP response. Zip compression stays off unless requested. - Notes and sections:
addNotes()adds speaker notes;addSection()groups slides into named sections. - TypeScript types: definitions ship in the package, and the
exportsfield inpackage.jsonpoints each bundler to the ESM or CommonJS build.
Templates rebuilt in code, version 4.1 still on a branch
PptxGenJS cannot open an existing .pptx. It writes presentations and reads none. Its author closed the question in 2021 in issue #912: ingesting existing documents "will never be implemented". A corporate PowerPoint template cannot be loaded as is; it has to be described again through defineSlideMaster(), with coordinates in inches or as a percentage of the slide.
A bad option shows up only when PowerPoint opens the file. A mistyped or out-of-range value can produce invalid XML, and PowerPoint then offers to repair the presentation without naming the faulty element. The documentation devotes a page to these "needs repair" errors and recommends removing slides, then objects, one at a time until the cause appears. Versions 4.0.0 and 4.0.1 still fix such errors in automatic table paging.
The npm package declares four dependencies. The README promises "zero runtime dependencies", yet the 4.0.1 package.json lists JSZip, image-size, https and @types/node. The integration guide asks for Node.js 18 or later. It also documents a Webpack 5 build, Docusaurus 3.7 in its example, that breaks on node:-prefixed modules until a plugin filters them out.
The latest release, 4.0.1, dates from June 2025. It follows 4.0.0 (May 2025), which came out more than two years after 3.12.0 (March 2023). The main branch has had no commit since. A version-4.1.0 branch kept receiving commits until August 2025 without producing a release. As of 26 October 2026, the repository has 236 open issues and 70 open pull requests.
