Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fabiospampinato/mime2ext

Convert a mime type to a file extension. It works only with popular mime types and its super lightweight.
https://github.com/fabiospampinato/mime2ext

convert detect ext extension infer mime mime-type

Last synced: about 1 month ago
JSON representation

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

Awesome Lists containing this project

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 --save mime2ext
```

## Usage

```ts
import mime2ext from 'mime2ext';

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

## License

MIT © Fabio Spampinato