Mapping of the most common MIME types on the Web by extension. Currently 75 extensions.
npm install web-mime-types
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"] }),
);
Map of file extension to MIME type
Kind: Exported constant See: MDN Common MIME types
MIT. See license file.