npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pptx-ts

v4.0.1

Published

Create PowerPoint presentations (.pptx) from TypeScript and modern JavaScript

Downloads

411

Readme

ts-pptx

npm weekly downloads total downloads CI License: MIT

Write a program, get a PowerPoint file.

A .pptx is a zip full of XML. ts-pptx writes that zip for you, so you describe slides in TypeScript and a .pptx comes out the other end. PowerPoint never runs, no Office licence is involved, and nothing has to be installed on the machine doing the writing. The file opens cleanly in desktop PowerPoint, and Keynote, LibreOffice Impress and Google Slides import it on a best-effort basis.

Reach for it when a deck has to be built from data that changes: a monthly report, one deck per customer, a hundred decks per night, or a download button on a page that hands the user a deck built from what they are looking at.

Install

pnpm add pptx-ts

@shbernal/ts-pptx is the same package under its first name, so install one or the other. Installation covers npm, CommonJS and the optional math dependencies.

Quick start

import TsPptx from "pptx-ts"

const pptx = new TsPptx()
const slide = pptx.addSlide()

slide.addText("Hello from ts-pptx", {
  x: 1,
  y: 1,
  w: 8,
  h: 1,
  fontSize: 24,
  color: "363636",
})

await pptx.writeFile({ fileName: "example.pptx" })

That is the whole shape of it. Make a presentation, add a slide, put things on the slide, write the file. Positions are in inches by default, so x: 1, y: 1 is an inch in from the top-left corner of a 10 by 5.625 inch slide. Your first deck builds a bigger one from data, with a table, a chart and speaker notes.

What you can put on a slide

Text and rich paragraphs. Tables, including ones that spill onto as many slides as they need. Shapes and connectors between them. Pictures, SVGs, video and audio. Charts, with a real embedded workbook behind them, so double-clicking a chart in PowerPoint opens its data the way it does for a chart a human made. Speaker notes, sections, slide masters and layouts, gradients, an image clipped to a shape, a spreadsheet embedded as an object, a 3D model, and LaTeX maths.

Two features worth knowing about by name:

  • An HTML table becomes slides. Point tableToSlides at a <table> you already have and it comes out as a PowerPoint table, paged across slides. Works in a browser and under Node.
  • Text that has to fit. ts-pptx can measure the text against the real font and shrink or grow the box before it writes the file, instead of leaving you to guess at font sizes.

Reading decks, not only writing them

Writing is half of it. ts-pptx also opens a .pptx you already have, which is unusual: the library it descends from generates decks and does not read them.

  • Look inside one and get slide count, size, parts, media and fonts, without loading the whole thing into a model.
  • Edit one. Open a deck, change the text on slide four, save it back. Parts you did not touch come out byte for byte as they went in.
  • Turn one into code. Point it at a deck and get TypeScript that rebuilds it. Anything it could not express is reported to you rather than dropped in silence. It is the fastest way to learn the API: build a slide by hand in PowerPoint, then read the script for it.

Where it runs

| Runtime | Load it with | writeFile | | --- | --- | --- | | Node.js 24 or later | import, or require() with the class on .default | writes to disk | | A browser app built with a bundler | import | downloads the file | | A browser page with no build step | import TsPptx from "https://esm.sh/pptx-ts/browser" in a module script | downloads the file | | Deno, Bun, edge workers | import | throws; use toBytes() |

Where it runs lists every entry point and how each runtime loads the one ESM build.

How this compares with PptxGenJS

ts-pptx is an independent derivative of PptxGenJS, detached at its v4.0.1. Both were measured on 2026-09-21 by building the same 22 deck intents with each library and reading the bytes that came out.

  • Construct coverage: ts-pptx emitted 21 of 22, pptxgenjs 10 of 22. Nothing in the corpus is emitted by pptxgenjs and not by ts-pptx.
  • Schema validity: of the decks each library built, 21 of 21 ts-pptx decks and 0 of 10 pptxgenjs decks validate with no error against the Open XML SDK.
  • Adoption: pptxgenjs is downloaded 10,539,687 times a month, against 1,780 for ts-pptx. If a large installed base matters to you more than the differences above, use pptxgenjs.
  • Activity: last commit on the default branch, 2026-09-15 for ts-pptx and 2025-06-26 for pptxgenjs. Last npm publish, 2026-08-29 and 2025-06-26.

Where the two libraries part company is on the comparison page, and how it was measured has every full table. Every intent as each library expresses it, including the calls that differ, is on porting from PptxGenJS.

Documentation

The documentation site, with the generated API reference, is at https://shbernal.github.io/ts-pptx/. The demos page builds a quarterly review deck in your browser and previews the slides.

Something wrong, or missing?

Open an issue: https://github.com/shbernal/ts-pptx/issues. Errors the library knows are its own fault print that link themselves.

If an agent writes most of your code, install the ts-pptx-upstream skill that ships inside the package. It turns a library defect the agent hits into a filed issue with a small reproduction, instead of a silent workaround:

npx skills add ./node_modules/pptx-ts -s '*' -a claude-code -a codex -a universal -y

Name the runtimes you use. CONTRIBUTING.md covers what the skill does with a report and how to refresh it after a version bump.

License

Copyright (c) 2015-2022 Brent Ely. Modifications copyright (c) 2026 shbernal.

MIT