Registry / serialization / exif-component

exif-component

JSON →
library1.0.1jsnpmunverified

Client-side EXIF parser for JPEG/TIFF images. Version 1.0.1 is the latest release. This is a fork of ExifReader with a simplified API, designed specifically for the Component package manager (not npm). It extracts metadata tags from an ArrayBuffer input. The package has not been updated since 2014 and targets legacy browser and Node.js environments. For modern usage, consider using the original ExifReader or exifr.

npm install exif-component
INSTALL
IMPORT
SIG · EXIF-COMPONENT
E
exif-component
serializationjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

exif
const exif = require('exif-component');
import exif from 'exif-component';
Package uses CommonJS and is not ESM-compatible. Default export is a function.
exif
const { exif } = require('exif-component');
import { exif } from 'exif-component';
Named import is incorrect; the package exports a single function directly.

Reads a JPEG file, converts the Node.js Buffer to an ArrayBuffer, and parses EXIF tags using the exif function.

const fs = require('fs'); const exif = require('exif-component'); // Read an image file as buffer const buffer = fs.readFileSync('image.jpg'); // Convert to ArrayBuffer const arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength); // Parse EXIF try { const tags = exif(arrayBuffer); console.log(JSON.stringify(tags, null, 2)); } catch (err) { console.error('Failed to parse EXIF:', err.message); }
Debug
Known issues
deprecatedThis package is a fork of ExifReader with a simplified API but has not been updated since 2014. Consider using the original ExifReader or exifr for modern applications.
fix
Use exifr (https://www.npmjs.com/package/exifr) or ExifReader (https://www.npmjs.com/package/exifreader) instead.
affects: >=0.0.0
gotchaThis package uses the Component package manager, not npm. Installation via npm will not work as expected.
fix
Install using component install component/exif or directly from GitHub. Alternatively, migrate to an npm-published EXIF library.
affects: >=0.0.0
gotchaThe library expects an ArrayBuffer, not a Buffer or Blob. Node.js users must convert Buffer to ArrayBuffer manually.
fix
Use buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength) to convert a Node.js Buffer to an ArrayBuffer.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: exif is not a function
Incorrect import style: using named import or ES import syntax on a CommonJS module that exports a single function.
fix
Use const exif = require('exif-component'); instead of import { exif } from 'exif-component'; or import exif from 'exif-component';.
Error: First argument must be an ArrayBuffer
Passing a Node.js Buffer or plain string instead of an ArrayBuffer.
fix
Convert Buffer to ArrayBuffer before calling exif: const arrayBuffer = buffer.buffer.slice(buffer.byteOffset, buffer.byteOffset + buffer.byteLength);
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
exif-component — npm install exif-component · libregistry