Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/fabiospampinato/mime2ext
- Owner: fabiospampinato
- License: mit
- Created: 2020-03-13T01:44:18.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T16:28:49.000Z (over 1 year ago)
- Last Synced: 2024-11-28T17:08:06.650Z (about 1 month ago)
- Topics: convert, detect, ext, extension, infer, mime, mime-type
- Language: JavaScript
- Size: 13.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
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