Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/RocktimSaikia/mime-type-check
Check all the available MIME types of an extension
https://github.com/RocktimSaikia/mime-type-check
mime-type mime-type-check mime-types
Last synced: 2 months ago
JSON representation
Check all the available MIME types of an extension
- Host: GitHub
- URL: https://github.com/RocktimSaikia/mime-type-check
- Owner: rocktimsaikia
- License: mit
- Created: 2020-10-02T17:11:43.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2020-10-17T09:04:40.000Z (over 3 years ago)
- Last Synced: 2024-03-30T20:20:36.919Z (3 months ago)
- Topics: mime-type, mime-type-check, mime-types
- Language: JavaScript
- Homepage:
- Size: 12.7 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Lists
- awesome-micro-npm-packages - mime-type-check - Get the MIME type of a file by its extension. (Modules / Other)
README
# mime-type-check ![build](https://travis-ci.com/RocktimSaikia/mime-type-check.svg?branch=master) ![license](https://img.shields.io/github/license/rocktimsaikia/mime-type-check)
> Check all the available `MIME types` of a extension.
It uses [Mime-db](https://github.com/jshttp/mime-db) as its core database.
Do not use this module to actually check the MIME type of a local or remote file. For that use [File-type](https://github.com/sindresorhus/file-type)## Install
```bash
npm install mime-type-check
```## Usage
```js
const getMimeType = require("mime-type-check");getMimeType("svg"); //=> ['image/svg+xml']
getMimeType("png"); //=> ['image/png']
getMimeType("3gpp"); //=> ['audio/3gpp', 'video/3gpp']
```## API
### getMimeType(string)
`string` is the extension to check the mimetypes for.
## License
MIT © [Rocktim Saikia](https://rocktim.xyz)