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

exif-purge

v1.0.5

Published

Strip EXIF/GPS/IPTC metadata from images before upload or storage, with an optional read-only inspector

Downloads

229

Readme

strip-exif

Module format

This package is ESM-only. Use import syntax in Node.js projects with type: module. CommonJS applications can load it with await import("exif-purge").

Strip EXIF, GPS, and other metadata from images before upload or storage - and optionally inspect what's embedded first.

Photos taken on phones and cameras routinely embed the exact GPS coordinates where they were shot, plus device make/model and timestamps. Apps that let users upload photos and don't strip this data can leak a user's precise location.

Install

npm install exif-purge

Requires Node.js >= 18. Uses sharp for image processing and exifr for reading metadata.

Usage

import { stripExif, readExif, hasGpsData } from 'exif-purge';

// Remove all EXIF/GPS/IPTC/XMP metadata, get back a clean Buffer.
// Visual orientation is preserved (rotation is baked into the pixels).
const cleanBuffer = await stripExif('photo.jpg');

// Inspect what's embedded before you strip it, e.g. to warn a user.
const info = await readExif('photo.jpg');
// { hasGps: true, latitude: 18.44, longitude: 73.86, make: 'samsung', model: 'SM-A525F', ... }

// Quick boolean check.
if (await hasGpsData('photo.jpg')) {
  console.warn('This photo contains GPS location data.');
}

All three functions accept a file path (string), an http(s) URL (string), or image bytes (Buffer / Uint8Array).

API

stripExif(input)

Returns Promise<Buffer> - the image re-encoded with all EXIF, IPTC, and XMP metadata removed. Any EXIF rotation is applied to the pixels first, so the output looks identical to the original, just without the embedded metadata.

readExif(input)

Returns Promise<ExifData>:

interface ExifData {
  hasGps: boolean;
  latitude: number | null;
  longitude: number | null;
  make: string | null;
  model: string | null;
  dateTimeOriginal: Date | null;
  orientation: number | string | null;
}

hasGpsData(input)

Returns Promise<boolean> - true if the image currently embeds GPS coordinates.

License

MIT

Security and privacy

Use this package before storing or sharing images when metadata privacy matters. Verify the output and remember that pixels can still contain identifying information.