This is a port of the popular JavaScript mime-db library to C#
mime-db is a large database of mime types and information about them. It consists of a single, public JSON file and does not include any logic, allowing it to remain as un-opinionated as possible with an API. It aggregates data from the following sources:
- https://www.iana.org/assignments/media-types/media-types.xhtml
- https://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types
- https://hg.nginx.org/nginx/raw-file/default/conf/mime.types
dotnet add package MimeDb.Net// grab data on .js files
var data = MimeDb.Items['application/javascript']The JSON file is a map lookup for lowercased mime types. Each mime type has the following properties:
.source- where the mime type is defined. If not set, it's probably a custom media type.apache- Apache common media typesiana- IANA-defined media typesnginx- nginx media types
.extensions[]- known extensions associated with this mime type..compressible- whether a file of this type can be gzipped..charset- the default charset associated with this type, if any.
The primary way to contribute to this database is by creating pull request to the original repo mime-db. See the contribution rules.