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

@chriscdn/exif

v0.0.21

Published

Assist in extracting EXIF information from JPG, PNG, and HEIC photos.

Readme

@chriscdn/exif

Motivation

EXIF metadata can be inconsistent, particularly when it comes to timestamps and location data. Many images store dates in local time without specifying a time zone, making it difficult to determine exactly when a photo was taken.

This library, built on exifr, extracts metadata from photos and aims to normalize:

  • Location – Extracts GPS coordinates and identifies the time zone.
  • Date & Time – Uses the time zone to determine the UTC time of the photo.
  • Dimensions – Retrieves the image width and height.

Attemps are made to normalize the results from exifr, which can vary among image types.

Note: This package has only been tested with HEIC, PNG, and JPG files.

This package addresses a personal use case, but perhaps someone else will find it useful.

Installation

Using npm:

npm install @chriscdn/exif

Using yarn:

yarn add @chriscdn/exif

Usage

import { exif, type TExifData } from "@chriscdn/exif";

// Node.js
const image = "./path/to/file.jpg";
const data: TExifData = await exif(image);

// Browser
const file: File;
const data: TExifData = await exif(file);

The TExifData return value

This is an opinionated return value which addresses my use case. Pull requests are welcome if you require other fields to be added.

  • latitude (number|null): The latitude of the image's location in decimal degrees rounded to six significant digits. If the location is unknown, this value will be null.
  • longitude (number|null): The longitude of the image's location in decimal degrees rounded to six significant digits. If the location is unknown, this value will be null.
  • timeZone (string|null): The time zone of the location where the image was taken, which is evaluated from the latitude and longitude. If the time zone is unavailable, this will be null.
  • localTime (string|null): The local time when the image was taken (relative to the specified timeZone), formatted as an ISO 8601 string (e.g., "2023-01-01T09:45:64"). If the local time is unavailable, this value will be null.
  • timestamp (number|null): The Unix timestamp (in milliseconds) representing when the image was taken. If the timestamp is unavailable, this will be null.
  • title (string|null): A title of the image, if available. If no title is provided, this will be null.
  • caption (string|null): A description or caption of the image, if available. If no description is provided, this will be null.
  • width (number): The width of the image in pixels.
  • height (number): The height of the image in pixels.
  • city (string|null): The city where the image was taken, if available. Otherwise, null.
  • state (string|null): The state or region where the image was taken, if available. Otherwise, null.
  • country (string|null): The country where the image was taken, if available. Otherwise, null.
  • countryCode (string|null): The ISO country code of the country where the image was taken, if available. Otherwise, null.
  • rating (number|null): A numeric rating of the image, if available. Otherwise, null.
  • mimetype (string|null): The MIME type of the image (e.g., image/jpeg), if available. Otherwise, null.
  • keywords (string[]): An array of keywords or tags associated with the image. If no keywords are available, this will be an empty array.

Notes

The library aims to standardize differences in exifr's output between JPG and PNG files, based on the variations observed in my tests with files exported from Lightroom. Additionally, it addresses this bug by correcting the date using the time zone or OffsetTimeOriginal value, if either is available.

Further testing is needed for PNGs from other sources.

License

MIT