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

pjpg

v0.1.1

Published

parse jpeg - read jpeg metadata

Readme

pjpg - parse jpegs

A collection of functions for reading and parsing segments of bytes in JPEG files.

index:

  • readAdobe
  • readComment
  • readIPTC
  • readJFIF
  • readMarkers
  • readMicrosoftPadding
  • readSegment
  • exif
  • util
  • app1
  • dict

Example Usage

//Sample code that loads a JPEG and console.logs some EXIF metadata if the file has any.

import fs from 'fs'
import pjpg from 'pjpg'

//load a JPEG file, make a buffer
const jpeg = fs.readFileSync('./IMG_0466.jpg')
const buffer = new ArrayBuffer(jpeg.byteLength)
new Uint8Array(buffer).set(jpeg)

//build a list of every JPEG marker in the file
const markers = pjpg.readMarkers(buffer)

markers.forEach(marker => {

	//APP1 segment (usually exif/adobe metadata)
	if (marker.byteMarker === 0xFFE1) {

		//get the ID of the APP1-segment to determine the type
		const id = pjpg.app1.readID(marker.offset, buffer)
		if (id === 'Exif') {

			//read the segment as EXIF metadata

			const exif = pjpg.exif.readExif(marker.offset, buffer)

			//console.log every tag in the first Image File Directory (IFD0)
			if (exif.hasOwnProperty('ifd0')) {
				exif.ifd0.tagList.forEach(tag => {
					const valueReadableByHumans = pjpg.dict.tiff.image.parseValue(tag)
					const tagName = pjpg.dict.tiff.image.getValue(tag.id, 'name')
					console.log(`${tagName}: ${valueReadableByHumans}`)
				})
			}
		}

	}
})

Dictionaries

there are a number of dictionary-like objects that can be used to convert raw tag values to something more legible.

dicts:
  • dict.tiff.image (information about tags stored in IFD0/IFD1. General Image tags)

  • dict.tiff.photo (information about tags stored in Exif sub-IFDs. Photography tags from digital cameras)

  • dict.tiff.gps (information about tags stored in GPS sub-IFDs.)

  • dict.tiff.iop (information about tags stored in IOP sub-IFDS (Interoperability information))

  • dict.iptc.envelope (8BIM tag information)

  • dict.iptc.application2 (8BIM tag information)

  • dict.jpeg (names of JPEG bytemarkers)