# mime2ext

> Convert a mime type to a file extension. It works only with popular mime types and it's super lightweight.

Latest version **2.0.1** (published 2025-01-17) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 40/100 (D)** — status: maintenance-mode.

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

Warnings: low downloads.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2025-01-17 |
| First published | 2020-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Maintainers | fabiospampinato |
| Keywords | mime, mime-type, detect, infer, convert, ext, extension |

## Links

- npm: https://www.npmjs.com/package/mime2ext
- Repository: https://github.com/fabiospampinato/mime2ext
- Homepage: https://github.com/fabiospampinato/mime2ext#readme
- Issues: https://github.com/fabiospampinato/mime2ext/issues
- npm.io page: https://npm.io/package/mime2ext

## Dependencies (1)

- [mime-standard](https://npm.io/package/mime-standard.md) ^1.0.3

## Alternatives

- [ext-list](https://npm.io/package/ext-list.md) — 6.3M weekly downloads
- [@lexical/selection](https://npm.io/package/@lexical/selection.md) — 3.8M weekly downloads
- [@lexical/text](https://npm.io/package/@lexical/text.md) — 3.6M weekly downloads
- [@lexical/clipboard](https://npm.io/package/@lexical/clipboard.md) — 3.0M weekly downloads
- [@tiptap/extension-mention](https://npm.io/package/@tiptap/extension-mention.md) — 3.0M weekly downloads

## Recent versions

- 2.0.1 (latest) — 2025-01-17
- 2.0.0 — 2022-04-06
- 1.0.1 — 2022-02-10
- 1.0.0 — 2020-03-13

## README

# Mime2Ext

Convert a mime type to a file extension. It works only with popular mime types and it's super lightweight.

This library is designed to only support the ~300 popular mime types listed [here](https://github.com/fabiospampinato/mime-standard/blob/master/src/index.ts).

## Install

```sh
npm install mime2ext
```

## Usage

```ts
import mime2ext from 'mime2ext';

// Let's convert a mime type to a file extension

mime2ext ( 'audio/mp3' ); // => 'mp3'
```

## License

MIT © Fabio Spampinato

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