Skip to content

Latest commit

 

History

History
36 lines (24 loc) · 1021 Bytes

File metadata and controls

36 lines (24 loc) · 1021 Bytes

minmay

Hex.pm License Hex.pm

GIF

Minmay is an Elixir library for mapping a file extension to MIME type or vice versa.

It was based in @samuelneff's MimeTypeMap

Installation

Add minmay to your list of dependencies in mix.exs:

def deps do
  [{:minmay, "~> 2.0"}]
end

Usage

iex> Minmay.from_extension(".jpg")
"image/jpeg"

iex> Minmay.from_filename("vacations.jpg")
"image/jpeg"

iex> Minmay.from_mime_type("image/jpeg")
".jpg"

No start/0 call is required — the library works immediately.