# mime-tree

> A helper for quickly determining the file type of a buffer

Latest version **0.1.4** (published 2022-02-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install mime-tree
pnpm add mime-tree
yarn add mime-tree
bun add mime-tree
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2022-02-23 |
| First published | 2022-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Josh McFarlin |
| Maintainers | josh-mcfarlin |
| Keywords | mime type, mime, image |

## Links

- npm: https://www.npmjs.com/package/mime-tree
- Repository: https://github.com/Josh-McFarlin/mime-tree
- Homepage: https://github.com/Josh-McFarlin/mime-tree#readme
- Issues: https://github.com/Josh-McFarlin/mime-tree/issues
- npm.io page: https://npm.io/package/mime-tree

## Recent versions

- 0.1.4 (latest) — 2022-02-23
- 0.1.3 — 2022-02-18
- 0.1.2 — 2022-02-18
- 0.1.1 — 2022-02-18

## README

# mime-tree

![](https://badgen.net/npm/v/mime-tree)
![](https://badgen.net/npm/license/mime-tree)
![](https://badgen.net/npm/types/mime-tree)
![](https://badgen.net/bundlephobia/min/mime-tree)
![](https://badgen.net/npm/dt/mime-tree)

## 👋 Intro

A helper for quickly determining the file type of a buffer.

This library is pure JavaScript, any can run in Node, the browser, or anywhere else JavaScript runs.
This library is exported in CommonJS and ES Modules.

Compared to other libraries that iterate through multiple arrays to find the mime type,
this helper detects mime type by looping through a single object.

### Supported File Types

* JPEG
* PNG
* GIF
* WEBP
* BMP
* TIFF
* AVIF

## 🚀 How to use

### Install

To install this library, use on of the following commands:
```bash
npm install -S mime-tree
yarn add mime-tree
```

### Use

```typescript
import mimeFromBuffer from "mime-tree";

const image: Uint8Array = ...;

const mimeType = mimeFromBuffer(image);
```

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