Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

mime-type-check

RocktimSaikia1.2kMIT2.0.0TypeScript support: included

Check all the available MIME types of a extension

mime, mime-type, mime-type-check, get-mime-type, mime-type-npm, mime-type-node

readme

mime-type-check build license

Check all the available MIME types of a extension.


It uses 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

Install

npm install mime-type-check

Usage

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.

Support