1.0.1 • Published 1 year ago

web-mime-types v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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.

1.0.1

1 year ago

1.0.0

1 year ago