# exif-wasm

> Extracts Exif metadata from images using WebAssembly. Uses the Rust package [kamadak-exif](https://crates.io/crates/kamadak-exif) internally for parsing and extracting the Exif metadata.

Latest version **0.1.1** (published 2022-05-18) · 0 weekly downloads

## Install

```sh
npm install exif-wasm
pnpm add exif-wasm
yarn add exif-wasm
bun add exif-wasm
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2022-05-18 |
| First published | 2022-05-18 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 162 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | sandrohc |

## Links

- npm: https://www.npmjs.com/package/exif-wasm
- npm.io page: https://npm.io/package/exif-wasm

## Recent versions

- 0.1.1 (latest) — 2022-05-18
- 0.1.0 — 2022-05-18

## README

# exif-wasm

Extracts Exif metadata from images using WebAssembly. Uses the Rust package [kamadak-exif](https://crates.io/crates/kamadak-exif) internally for parsing and extracting the Exif metadata.

Supported formats:
- JPEG
- PNG
- TIFF
- WebP
- HEIF (HEIC and AVIF)

## Installation

This package can be installed via:

```bash
npm install --save exif-wasm
```

## Usage

```typescript
import init, { get_exif } from 'exif-wasm';

// Initialize the Exif WebAssembly module
init()
    .then(() => console.debug('Exif WebAssembly module loaded'))
    .catch(error => console.error('Exif WebAssembly module failed to load with error:', error));

// Download the image & extract Exif metadata
fetch('image.jpg')
    .then(res => res.buffer())
    .then(bytes => new Uint8Array(bytes))
    .then(array => get_exif(array))
    .then(console.log);
```

The output will be in the format:

```javascript
let exif = {
    success: true,
    error_type: null,
    error_message: null,
    fields: [
        {
            tag: {
                id: 306,
                name: "File change date and time",
                default_value: null
            },
            value: "2022-12-31 12:00:00"
        },
        ...
    ]
}
```

---
_Source: https://npm.io/package/exif-wasm · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
