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

x/deno/std/media_types/mod.ts>contentType

A modern runtime for JavaScript and TypeScript.
Go to Latest
function contentType
import { contentType } from "https://deno.land/x/deno@v0.28.0/std/media_types/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