{"id":21011814,"url":"https://github.com/khellang/mimetypes","last_synced_at":"2025-04-04T13:09:11.996Z","repository":{"id":20486421,"uuid":"23764541","full_name":"khellang/MimeTypes","owner":"khellang","description":"A simple lookup from file name/extension to MIME/media type, generated from mime-db, which in turn is compiled from IANA, Apache and nginx's MIME types.","archived":false,"fork":false,"pushed_at":"2024-07-23T08:16:05.000Z","size":103,"stargazers_count":97,"open_issues_count":5,"forks_count":24,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T12:50:30.364Z","etag":null,"topics":["lookup","mime","mimetypes"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/khellang.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-09-07T16:27:16.000Z","updated_at":"2025-03-17T08:33:48.000Z","dependencies_parsed_at":"2024-06-19T11:18:11.998Z","dependency_job_id":"6a9f9ca6-ad99-4778-8753-5dbc1cb72483","html_url":"https://github.com/khellang/MimeTypes","commit_stats":{"total_commits":68,"total_committers":6,"mean_commits":"11.333333333333334","dds":0.07352941176470584,"last_synced_commit":"82b85fffae04bd1c39830b2c08757429913a6878"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FMimeTypes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FMimeTypes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FMimeTypes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/khellang%2FMimeTypes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/khellang","download_url":"https://codeload.github.com/khellang/MimeTypes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182390,"owners_count":20897381,"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":["lookup","mime","mimetypes"],"created_at":"2024-11-19T09:31:24.735Z","updated_at":"2025-04-04T13:09:11.972Z","avatar_url":"https://github.com/khellang.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MimeTypes\n\nA simple lookup from file name/extension to MIME/media type and vice versa, generated from [mime-db](https://github.com/jshttp/mime-db), which in turn is compiled from IANA, Apache and nginx's MIME types.  \nThis is a source-only package, containing a single class, `MimeTypes`, which will be compiled into your library/application under the root namespace.\n\n## Installation\n\nThe easiest way to get it, is to install the source package from [NuGet.org](https://www.nuget.org/packages/MimeTypes).\n\nOtherwise you could just pull the [source file](src/MimeTypes/MimeTypes.cs.pp) from GitHub.\n\n## Usage\n\n### Lookup MIME/media type for a file name/extension\n\nGet the MIME/media type for a file name/extension by using the `MimeTypes.TryGetMimeType` or `MimeTypes.GetMimeType` methods:\n\n```csharp\nif (MimeTypes.TryGetMimeType(\"awesome-file.json\", out var mimeType))\n{\n    // mimeType == \"application/json\"\n}\n\nMimeTypes.GetMimeType(\"awesome-file.json\"); // \"application/json\"\n```\n\nWhen calling `GetMimeType`, if a mapping for the given file extension doesn't exist, it will fall back to `MimeTypes.FallbackMimeType`, which is set to `application/octet-stream` by default.\n\n### Lookup file extension by MIME/media type\n\nTo get all available file extensions for a MIME/media type, you can call `MimeTypes.GetMimeTypeExtensions`. This returns back an `IEnumerable\u003cstring\u003e` of all the available files types for the specified MIME/media type.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhellang%2Fmimetypes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhellang%2Fmimetypes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhellang%2Fmimetypes/lists"}