JSPM

web-mime-types

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q29191F
  • License MIT

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

Package Exports

  • web-mime-types

Readme

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.