Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabiospampinato/ext2mime
Convert a file extension to a mime type. It works only with popular file extensions and it's super lightweight.
https://github.com/fabiospampinato/ext2mime
convert detect ext extension infer mime mime-type
Last synced: about 1 month ago
JSON representation
Convert a file extension to a mime type. It works only with popular file extensions and it's super lightweight.
- Host: GitHub
- URL: https://github.com/fabiospampinato/ext2mime
- Owner: fabiospampinato
- License: mit
- Created: 2020-04-16T15:45:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-24T16:28:49.000Z (over 1 year ago)
- Last Synced: 2024-11-06T11:55:04.203Z (about 2 months ago)
- Topics: convert, detect, ext, extension, infer, mime, mime-type
- Language: JavaScript
- Size: 14.6 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# Ext2Mime
Convert a file extension to a mime type. It works only with popular file extensions and it's super lightweight.
This is basically the inverse of [`mime2ext`](https://github.com/fabiospampinato/mime2ext).
## Install
```sh
npm install --save ext2mime
```## Usage
```ts
import ext2mime from 'ext2mime';ext2mime ( 'mp3' ); // => 'audio/mpeg'
ext2mime ( '.mp3' ); // => 'audio/mpeg'
```## License
MIT © Fabio Spampinato