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

office-sweep

v3.0.2

Published

![office-sweep](assets/banner.svg) [![npm version](https://badge.fury.io/js/office-sweep.svg)](https://badge.fury.io/js/office-sweep) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)

Readme

office-sweep npm version License: MIT

Remove metadata, comments, notes, and other artifacts from Office files. Extract assets like images. Supports .pptx and .docx, with more formats planned.

Why?

Office files carry hidden baggage — author names, edit timestamps, revision history, presenter notes, embedded comments, and thumbnail previews. When you share a file externally, this metadata can leak sensitive information. office-sweep strips it all out programmatically, so you can clean files before distribution, as part of a CI pipeline, or in any Node.js workflow.

You can also extract embedded assets like images from your documents.

Install

npm install office-sweep

Quick start

Remove metadata from a PowerPoint

import { officeSweep } from "office-sweep";

await officeSweep("presentation.pptx", {
  remove: {
    destinationFilePath: "presentation-clean.pptx",
    ppt: {
      totalTime: true,
      core: {
        title: true,
        creator: true,
        lastModifiedBy: true,
        revision: true,
        created: true,
        modified: true,
      },
      thumbnail: true,
      notes: true,
      comments: { modern: true, legacy: true },
      authors: true,
      view: true,
    },
  },
});

Remove comments from a Word document

await officeSweep("document.docx", {
  remove: {
    destinationFilePath: "document-clean.docx",
    word: {
      comments: true,
    },
  },
});

Extract images from a presentation

const result = await officeSweep("presentation.pptx", {
  extract: {
    destinationFolderPath: "./output",
    images: true,
  },
});

console.log(result.images);
// [{ name: "image1.png", path: "/output/images/image1.png", slideIndexes: [0, 2] }]

API

officeSweep(sourcePath, options)

| Parameter | Type | Description | | ------------ | -------------- | ------------------------------ | | sourcePath | string | Path to the source Office file | | options | SweepOptions | Configuration object |

Use either remove or extract in a single call — not both.

Options

type SweepOptions = {
  remove?: {
    destinationFilePath: string;
    ppt?: { /* PowerPoint-specific options */ };
    word?: { /* Word-specific options */ };
  };
  extract?: {
    destinationFolderPath: string;
    images?: boolean;
  };
};

PowerPoint options (remove.ppt)

| Option | Type | Description | | --------------------------- | --------- | -------------------------------------------------------- | | totalTime | boolean | Remove total editing time | | core.title | boolean | Remove the presentation title | | core.creator | boolean | Remove the original author name | | core.lastModifiedBy | boolean | Remove the last editor's name | | core.revision | boolean | Remove the revision count | | core.created | boolean | Remove the creation timestamp | | core.modified | boolean | Remove the last-modified timestamp | | thumbnail | boolean | Remove the thumbnail preview image | | notes | boolean | Remove all presenter notes | | comments.modern | boolean | Remove modern comments (Office 2018+ spec) | | comments.legacy | boolean | Remove legacy comments (Office 2006 spec) | | authors | boolean | Remove the authors list | | view | boolean | Remove saved view/window settings | | image.metadata | boolean | Remove metadata embedded in images | | image.hanging | boolean | Remove unused/orphaned images |

Word options (remove.word)

| Option | Type | Description | | ---------- | --------- | --------------------- | | comments | boolean | Remove all comments |

Extract options (extract)

| Option | Type | Description | | ----------------------- | --------- | ---------------------------------------------- | | destinationFolderPath | string | Output folder (an images/ subfolder is created) | | images | boolean | Extract all embedded images |

Return value

When using remove, returns {} on success.

When using extract, returns:

{
  success: true,
  images: Array<{
    name: string;         // Filename, e.g. "image1.png"
    path: string;         // Absolute path to extracted file
    slideIndexes: number[]; // Which slides reference this image
  }>
}

Supported formats

| Format | Remove metadata | Extract images | | ------ | :-------------: | :------------: | | .ppt / .pptx | ✅ | ✅ | | .doc / .docx | ⚠️* | ✅ | | .xls / .xlsx | ❌ | ❌ |

* = Comments only

Use cases

  • Pre-distribution cleanup — Strip author names, comments, and notes before sending files to clients or publishing externally.
  • CI/CD pipelines — Automate metadata removal as a build step for generated reports or slide decks.
  • Privacy compliance — Ensure internal metadata doesn't leak in shared documents.
  • Asset extraction — Pull all images from a presentation for reuse in other projects.

License

MIT © Marcdj-02