# metalyzer

> A library to retrieve dimensions of media files

Latest version **1.0.13** (published 2024-01-11) · MITA license · 0 weekly downloads

## Install

```sh
npm install metalyzer
pnpm add metalyzer
yarn add metalyzer
bun add metalyzer
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.13 |
| Published | 2024-01-11 |
| First published | 2023-12-08 |
| Weekly downloads | 0 |
| License | MITA |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 21.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | CodeCraft -k |
| Maintainers | media.craft |
| Keywords | video thumbnail, image url, video url, video dimensions, image dimensions, video duration |

## Links

- npm: https://www.npmjs.com/package/metalyzer
- Repository: https://github.com/craft-developers/metalyzer
- Issues: https://github.com/craft-developers/metalyzer/issues
- npm.io page: https://npm.io/package/metalyzer

## Dependencies (1)

- [buffer](https://npm.io/package/buffer.md) ^6.0.3

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.13 (latest) — 2024-01-11
- 1.0.12 — 2024-01-03
- 1.0.11 — 2024-01-03
- 1.0.10 — 2023-12-25
- 1.0.9 — 2023-12-21
- 1.0.8 — 2023-12-21
- 1.0.7 — 2023-12-19
- 1.0.6 — 2023-12-16
- 1.0.4 — 2023-12-11
- 1.0.1 — 2023-12-09
- 1.0.0 — 2023-12-08

## README

## metalyzer

**metalyzer** is a lightweight JavaScript library for extracting metadata from video/Image files. It provides a simple API to retrieve information such as type, size, dimensions, base64, blob, URL,thumbail,video-duration, and more.

## Installation

```
npm install metalyzer
```

## Usage for Video

```Typescript
const metaData = await extractVideoMetadata(video);
const videoUrl = await extractVideoUrl(video);
const videoBlob = await convertVideoInBlob(video);
console.log(metaData);
console.log(videoUrl);
console.log(videoUrl);
```

## Usage for Image

```Typescript
const metaData = await extractImageMetadata(video);
const imageUrl = await extractImageUrl(video);
const imageBase64 = await extractImagebase64(video);
const [thumbnail1, thumbnail2] = await extractThumbnailFromVideo(video);
console.log(metaData);
console.log(imageUrl);
console.log(imageBase64);
<img src={thumbnail1} />
<img src={thumbnail2} />
```

## Features

- Extracts various video metadata, including file name,url,base64, blobm, dimensions, duration, etc.
- Provides a simple and easy-to-use API for metadata extraction.

## APIs

```Typescript
    extractVideoMetadata(videoFile: File): Promise<VideoMetadata>
    extractImageBase64(imageFile: File): Promise<string>;
    extractImageMetadata(imageFile: File): Promise<ImageMetadata>;
    extractImageUrl(imageFile: File): Promise<string>;
    convertVideoInBlob(videoFile: File): Promise<Blob>;
    extractVideoMetadata(videoFile: File): Promise<VideoMetadata>;
    extractVideoUrl(videoFile: File): Promise<string>;
    getFileExtension(fileName: string): string;
    extractThumbnailFromVideo(videoFile: File): Promise<File>
```

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

## Contributing

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct and the process for submitting pull requests to us.

## Issues

If you discover any issues, please [open an issue](https://github.com/your-username/metalyzer/issues).

## Changelog

See the [CHANGELOG.md](CHANGELOG.md) file for details on changes and releases.

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