web-mime-types
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i web-mime-types

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

7.99 kB

Total Files

6

Last publish

Collaborators

  • dmnsgn