Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Erlang MIME types library
branch: master

This branch is 34 commits behind spawngrid:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
priv
src
test
.gitignore
README.md
THANKS
post_compile.escript
rebar.config

README.md

mimetypes

mimetypes is an Erlang library to fetch MIME extension/name mappings.

Usage

$ erl -pa ebin                  
Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [hipe] [kernel-poll:false]

Eshell V5.8.4  (abort with ^G)
1> application:start(mimetypes).
ok
2> mimetypes:extension(<<"js">>).
<<"application/javascript">>
3> mimetypes:extension(<<"mb">>).
<<"application/mathematica">>
4> mimetypes:extension(<<"html">>).
<<"text/html">>
5> mimetypes:extension(<<"m3u8">>).    
[<<"application/vnd.apple.mpegurl">>,
 <<"application/x-mpegurl">>]
6> mimetypes:filename("/a/b.js").
<<"application/javascript">>
7> mimetypes:extensions("application/mathematica").
[<<"ma">>,<<"nb">>,<<"mb">>]
Something went wrong with that request. Please try again.