PptxGenJS generates PowerPoint .pptx files from TypeScript and modern
JavaScript. This maintained project targets ESM package consumers, typed
application code, reproducible package verification, and agent-assisted OOXML
development.
- Generate standards-based PowerPoint
.pptxpackages without requiring PowerPoint at runtime. - Support TypeScript-first workflows with checked declarations and modern bundler resolution.
- Ship a small, explicit ESM package boundary for Node.js, Vite, React, Angular, Electron, and similar modern toolchains.
- Keep OOXML changes grounded in fixtures, schema validation, and PowerPoint compatibility evidence.
- Make the repository practical for human and agent-driven maintenance.
pnpm add @shbernal/pptxgenjsnpm install @shbernal/pptxgenjsyarn add @shbernal/pptxgenjsimport pptxgen from "@shbernal/pptxgenjs"
const pptx = new pptxgen()
const slide = pptx.addSlide()
slide.addText("Hello from PptxGenJS", {
x: 1,
y: 1,
w: 8,
h: 1,
fontSize: 24,
color: "363636",
})
await pptx.writeFile({ fileName: "example.pptx" })- Slides, layouts, masters, sections, notes, and metadata.
- Text, tables, shapes, images, SVGs, charts, and media.
- Browser-downloadable, streamed, buffered, Blob, base64, or file outputs, depending on the runtime.
- OOXML that is intended to open cleanly in Microsoft PowerPoint and other
.pptxconsumers such as Keynote, LibreOffice Impress, and Google Slides import.
The package is ESM-only.
Supported package surface:
import pptxgen from "@shbernal/pptxgenjs"import { ShapeType } from "@shbernal/pptxgenjs/core"import pptxgen from "@shbernal/pptxgenjs/node"import pptxgen from "@shbernal/pptxgenjs/browser"import pptxgen from "@shbernal/pptxgenjs/standalone"- generated runtime and declaration artifacts under
dist/ - Node.js
>=24 - modern bundlers and module-aware app frameworks
Dropped compared to upstream:
- No CommonJS support: no
require("@shbernal/pptxgenjs"), no CJS export condition, and nodist/pptxgen.cjs.js. Modern Node.js may providerequire()interop for ESM, but it is not a maintained API. - No IIFE/global browser bundle: no
window.PptxGenJSclassic script API, nodist/pptxgen.bundle.js, and nodist/pptxgen.min.js.
The old named ESM artifact dist/pptxgen.es.js is also no longer shipped. Use
the package exports instead of direct artifact paths.
See runtime and package support for the complete support contract.
- Documentation index
- Project target
- Runtime and package support
- Development guide
- Testing guide
- Agent development guide
- OOXML agent context
- Upstream signal workflow
- Legacy autoloop workflow
This repository uses pnpm and requires Node.js >=24.
pnpm install
pnpm run build
pnpm run typecheck
pnpm run test:unitOOXML serialization changes should also add or update a schema fixture and run:
./tools/ooxml-validator/install.sh
pnpm run test:schemaPackage-boundary changes should run:
pnpm run build
pnpm run package:lint
pnpm run pack:check
pnpm run test:packagedemos/nodeexercises Node.js ESM generation and stream output.demos/vite-demoexercises a modern React, TypeScript, and Vite app.
This project builds on PptxGenJS by Brent Ely and contributors. The modernized package target is intentionally narrower than upstream in order to simplify the runtime contract and keep maintenance focused.
Copyright (c) 2015-present Brent Ely and PptxGenJS contributors. Fork modifications copyright (c) 2026 shbernal.