Skip to main content
Module

x/media_types/mod.ts

A module that assists in resolving media types and extensions.
Extremely Popular
Go to Latest
import * as mediaTypes from "https://deno.land/x/media_types@v3.0.3/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.