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

x/ayonli_jsext/filetype.ts>getExtensions

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

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

Examples

Example 1

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

console.log(getExtensions("image/png")); // [".png"]
console.log(getExtensions("public.png")); // [".png"]

Parameters

type: string

Returns

string[]