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

@arraypress/file-metadata

v1.0.0

Published

Extract EXIF/IPTC metadata from images and ID3 tags from audio. Zero dependencies.

Readme

@arraypress/file-metadata

Extract EXIF/IPTC metadata from images and ID3 tags from audio. Zero dependencies, safe binary parsing.

Works in browsers, Cloudflare Workers, Node.js 18+, Deno, and Bun.

Installation

npm install @arraypress/file-metadata

Usage

import { extractMetadata } from '@arraypress/file-metadata';

// JPEG with EXIF/IPTC
const meta = await extractMetadata(fileInput.files[0]);
// { type: 'image', title: 'Sunset', description: 'Golden hour shot', artist: 'Jane', copyright: '© 2024' }

// MP3 with ID3 tags
const meta = await extractMetadata(audioFile);
// { type: 'audio', title: 'Dark Ambient Pad', artist: 'Studio X', album: 'Vol 1' }

// Unsupported type or no metadata
const meta = await extractMetadata(pngFile);
// {}

API

extractMetadata(input)

Extract metadata from a File, Blob, or ArrayBuffer. Returns a promise.

Image metadata (JPEG with EXIF/IPTC):

  • type'image'
  • title — IPTC Headline or EXIF ImageDescription
  • description — IPTC Caption or EXIF ImageDescription
  • artist — IPTC By-line or EXIF Artist
  • copyright — IPTC Copyright or EXIF Copyright
  • keywords — IPTC Keywords (array)

Audio metadata (MP3 with ID3v1/v2):

  • type'audio'
  • title — TIT2 (ID3v2) or Title (ID3v1)
  • artist — TPE1 (ID3v2) or Artist (ID3v1)
  • album — TALB (ID3v2) or Album (ID3v1)
  • genre — TCON (ID3v2)
  • copyright — TCOP (ID3v2)
  • description — TIT3 subtitle (ID3v2)

Returns empty object {} for unsupported types, missing metadata, or parse failures.

hasExtractableMetadata(mimeType)

Quick check if a MIME type supports metadata extraction. Returns true for image/jpeg, image/tiff, and audio/*.

Security

  • Bounded reads — only reads first 64KB (images) or 32KB (audio), never the whole file
  • Sanitized output — all strings stripped of null bytes and control characters, capped at 1KB
  • Validated offsets — every pointer/offset is bounds-checked before reading
  • Fail safe — returns {} on any parse error, never throws
  • No execution — purely reads bytes, no eval/Function/dynamic code

Supported Formats

| Format | Source | Tags Read | |---|---|---| | JPEG | EXIF IFD0 | ImageDescription, Artist, Copyright | | JPEG | IPTC-NAA | Headline, Caption, By-line, Copyright, Keywords | | MP3 | ID3v2.3/v2.4 | TIT2, TPE1, TALB, TCON, TCOP, TIT3 | | MP3 | ID3v1 | Title, Artist, Album |

PNG, WebP, GIF, WAV, FLAC, and other formats are not supported (they either don't contain EXIF/ID3 or use different metadata formats).

License

MIT