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

x/deno/std/media_types/mod.ts

A modern runtime for JavaScript and TypeScript.
Go to Latest
import * as deno from "https://deno.land/x/deno@v0.22.0/std/media_types/mod.ts";

Variables

A map of extensions for a given media type

A map of the media type for a given extension

Functions

Given a media type return any default charset string. Returns undefined if not resolvable.

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

Given a media type, return the most appropriate extension or return undefined if there is none.

Given an extension, lookup the appropriate media type for that extension. Likely you should be using contentType() though instead.