Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/filetype.ts>getMIME

A JavaScript extension package for building strong and modern applications.
Latest
function getMIME
import { getMIME } from "https://deno.land/x/ayonli_jsext@v0.9.72/filetype.ts";

Returns the corresponding MIME type for the given type, where the type is a file extension or a UTI (Uniform Type Identifier) name.

Examples

Example 1

import { getMIME } from "@ayonli/jsext/filetype";

console.log(getMIME(".png")); // image/png
console.log(getMIME("public.png")); // image/png

Parameters

type: string

Returns

string | undefined