{"id":23226014,"url":"https://github.com/erlangpack/mimetypes","last_synced_at":"2025-08-19T13:32:38.003Z","repository":{"id":1599205,"uuid":"2152371","full_name":"erlangpack/mimetypes","owner":"erlangpack","description":"Erlang MIME types library","archived":false,"fork":false,"pushed_at":"2022-06-10T10:34:09.000Z","size":177,"stargazers_count":76,"open_issues_count":2,"forks_count":43,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-05-01T23:25:41.165Z","etag":null,"topics":["erlang","mime-types"],"latest_commit_sha":null,"homepage":"https://hex.pm/packages/mimetypes","language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erlangpack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-08-04T02:42:15.000Z","updated_at":"2023-09-10T21:37:32.000Z","dependencies_parsed_at":"2022-08-28T11:11:31.307Z","dependency_job_id":null,"html_url":"https://github.com/erlangpack/mimetypes","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlangpack%2Fmimetypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlangpack%2Fmimetypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlangpack%2Fmimetypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erlangpack%2Fmimetypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erlangpack","download_url":"https://codeload.github.com/erlangpack/mimetypes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230187314,"owners_count":18186947,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["erlang","mime-types"],"created_at":"2024-12-19T00:15:09.796Z","updated_at":"2024-12-19T00:15:10.412Z","avatar_url":"https://github.com/erlangpack.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status][gh badge]][gh]\n[![Hex.pm version][hexpm version]][hexpm]\n[![Hex.pm Downloads][hexpm downloads]][hexpm]\n[![Hex.pm Documentation][hexdocs documentation]][hexdocs]\n[![Erlang Versions][erlang version badge]][gh]\n\nmimetypes\n=========\n\n`mimetypes` is an Erlang library to fetch MIME extension/name mappings.\n\nUsage\n-----\n\n```erlang\n1\u003e application:start(mimetypes).\nok\n2\u003e mimetypes:extension(\u003c\u003c\"js\"\u003e\u003e).\n\u003c\u003c\"application/javascript\"\u003e\u003e\n3\u003e mimetypes:extension(\u003c\u003c\"mb\"\u003e\u003e).\n\u003c\u003c\"application/mathematica\"\u003e\u003e\n4\u003e mimetypes:extension(\u003c\u003c\"html\"\u003e\u003e).\n\u003c\u003c\"text/html\"\u003e\u003e\n5\u003e mimetypes:extension(\u003c\u003c\"m3u8\"\u003e\u003e).    \n[\u003c\u003c\"application/vnd.apple.mpegurl\"\u003e\u003e,\n \u003c\u003c\"application/x-mpegurl\"\u003e\u003e]\n6\u003e mimetypes:filename(\"/a/b.js\").\n\u003c\u003c\"application/javascript\"\u003e\u003e\n7\u003e mimetypes:extensions(\u003c\u003c\"application/mathematica\"\u003e\u003e).\n[\u003c\u003c\"ma\"\u003e\u003e,\u003c\u003c\"nb\"\u003e\u003e,\u003c\u003c\"mb\"\u003e\u003e]\n```\n\nAdditional types\n----------------\n\nAdditional mappings can be loaded at runtime using the ```mimetypes:load/2```\nfunction. If this function is timing out it is possible to increase the\ntimeout using ```mimetypes:load/3```.\n\n``` erlang\n1\u003e application:start(mimetypes).\nok\n2\u003e mimetypes:load(default, [{\u003c\u003c\"ext\"\u003e\u003e, \u003c\u003c\"new/type\"\u003e\u003e}]).\nok\n3\u003e mimetypes:extension(\u003c\u003c\"ext\"\u003e\u003e).\n[\u003c\u003c\"application/vnd.novadigm.ext\"\u003e\u003e,\u003c\u003c\"new/type\"\u003e\u003e]\n2\u003e mimetypes:load(default, [{\u003c\u003c\"ext\"\u003e\u003e, \u003c\u003c\"new/type\"\u003e\u003e}], 10000).\nok\n```\n\nAdditional mappings can also be specified using the application environment\nvariables for the ```mimetypes``` application. These can be added to the\nconfig file specified using the ```erl -config``` flag.\n\n``` erlang\n[{mimetypes, [\n    %% Wait for all additional types to be loaded before returning from\n    %% application:start(mimetypes). Set to false to return immidiately\n    %% and load them in the background.\n    {load_async, true},\n    %% Timeout to use for calls to mimetypes:load/3 while loading additional\n    %% mimetypes. The default is the same as for mimetypes:load/2. You may\n    %% need to increase this value.\n    {load_timeout, 5000},\n    {load, [\n        {default, [\n            {\u003c\u003c\"ext\"\u003e\u003e, \u003c\u003c\"new/type\"\u003e\u003e}\n        ]}\n    ]}\n]}].\n```\n\n\u003c!-- Badges --\u003e\n[hexpm]: https://hex.pm/packages/mimetypes\n[hexpm version]: https://img.shields.io/hexpm/v/mimetypes.svg?style=flat-curcle \"Hex version\"\n[hexpm downloads]: https://img.shields.io/hexpm/dt/mimetypes.svg?style=flat-curcle\n[hexdocs documentation]: https://img.shields.io/badge/hex-docs-purple.svg?style=flat-curcle\n[hexdocs]: https://hexdocs.pm/mimetypes\n[gh]: https://github.com/erlangpack/mimetypes/actions/workflows/test.yaml\n[gh badge]: https://github.com/erlangpack/mimetypes/workflows/Test/badge.svg\n[erlang version badge]: https://img.shields.io/badge/Supported%20Erlang%2FOTP-22%20to%2024-blue.svg?style=flat-curcle\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlangpack%2Fmimetypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferlangpack%2Fmimetypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferlangpack%2Fmimetypes/lists"}