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-content-extractor

v1.0.3

Published

A Node.js library for extracting slides, notes, and media from PowerPoint (.pptx) files.

Readme

PPTX Content Extractor

PPTX Content Extractor is a Node.js library for extracting slides, notes, and media content (e.g., images) from .pptx files. This tool leverages JSZip for unpacking .pptx archives and xml2js for parsing XML-based content.

Features

  • Extract text content from PowerPoint slides (.pptx).
  • Retrieve media files (e.g., images) embedded in the presentation.
  • Extract speaker notes for each slide.
  • Modular structure for extracting specific content types (slides, media, or notes).

Installation

Install the library via npm:

npm install --save pptx-content-extractor

Usage

Full Extraction

Extract all slides, media, and notes from a .pptx file:

import { extractPptx } from 'pptx-content-extractor';

(async () => {
  const result = await extractPptx('/path/to/presentation.pptx');
  console.log('Slides:', result.slides);
  console.log('Media:', result.media);
  console.log('Notes:', result.notes);
})();

Extract specific content

Slides

import { extractPptxSlides } from 'pptx-content-extractor';

(async () => {
  const slides = await extractPptxSlides('/path/to/presentation.pptx');
  console.log('Slides:', slides);
})();

Media

import { extractPptxMedia } from 'pptx-content-extractor';

(async () => {
  const media = await extractPptxMedia('/path/to/presentation.pptx');
  console.log('Media:', media);
})();

Notes

import { extractPptxNotes } from 'pptx-content-extractor';

(async () => {
  const notes = await extractPptxNotes('/path/to/presentation.pptx');
  console.log('Notes:', notes);
})();

API

extractPptx(filePath: string): Promise<ParsedPowerPoint>

Extracts slides, media, and notes from a .pptx file.

  • filePath: Path to the .pptx file.
  • Returns: A Promise<ParsedPowerPoint> containing:
    • slides: An array of parsed slides.
    • media: An array of media content.
    • notes: An array of parsed notes.

extractPptxSlides(filePath: string): Promise<ParsedSlide[]>

Extracts only the slides.

  • filePath: Path to the .pptx file.
  • Returns: A Promise<ParsedSlide[]> containing parsed slides.

extractPptxMedia(filePath: string): Promise<ParsedMedia[]>

Extracts only the media content.

  • filePath: Path to the .pptx file.
  • Returns: A Promise<ParsedMedia[]> containing media content.

extractPptxNotes(filePath: string): Promise<ParsedNote[]>

Extracts only the notes.

  • filePath: Path to the .pptx file.
  • Returns: A Promise<ParsedNote[]> containing parsed notes.

Types

ParsedContent

Base interface for parsed content.

export interface ParsedContent {
  name: string;
  content: unknown;
}

ParsedPptx

export interface ParsedPowerPoint {
  slides: ParsedSlide[];
  media: ParsedMedia[];
  notes: ParsedNote[];
}

ParsedSlide

export interface ParsedSlide extends ParsedContent {
  content: { id: string; type: string; text: string[] }[];
  mediaNames: string[] // names of media file e.g. ['image23.jpeg']
}

ParsedMedia

export interface ParsedMedia extends ParsedContent {
  content: string; // Base64-encoded media content
}

ParsedNote

export interface ParsedNote extends ParsedContent {
  content: string;
}