Skip to content

Mapping of the most common MIME types on the Web by extension. Currently 75 extensions.

License

Notifications You must be signed in to change notification settings

dmnsgn/web-mime-types

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

web-mime-types

npm version stability-stable npm minzipped size dependencies types Conventional Commits styled with prettier linted with eslint license

Mapping of the most common MIME types on the Web by extension. Currently 75 extensions.

paypal coinbase twitter

Installation

npm install web-mime-types

Usage

import webMimeTypes from "web-mime-types";

const jpegData = await (await fetch(url)).arrayBuffer();

const image = document.createElement("image");
image.src = URL.createObjectURL(
  new Blob([jpegData], { type: webMimeTypes["jpg"] }),
);

API

web-mime-types

MIMETypesByExtension : Object.<string, MIMEType>

Map of file extension to MIME type

Kind: Exported constant See: MDN Common MIME types

License

MIT. See license file.