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

x/media_types/mod.ts>contentType

A module that assists in resolving media types and extensions.
Extremely Popular
Go to Latest
function contentType
import { contentType } from "https://deno.land/x/media_types@v3.0.3/mod.ts";

Given an extension or media type, return the full Content-Type header string. Returns undefined if not resolvable.

Parameters

str: string

Returns

string | undefined