Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankhaugen/frank.mimetypes
This is a generated library that has a huge amout of mime-types integrated
https://github.com/frankhaugen/frank.mimetypes
content-types dotnet dotnet-core library mime-types nuget-package
Last synced: 16 days ago
JSON representation
This is a generated library that has a huge amout of mime-types integrated
- Host: GitHub
- URL: https://github.com/frankhaugen/frank.mimetypes
- Owner: frankhaugen
- License: mit
- Created: 2023-12-15T21:50:21.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-17T15:00:42.000Z (11 months ago)
- Last Synced: 2024-05-01T17:28:38.948Z (7 months ago)
- Topics: content-types, dotnet, dotnet-core, library, mime-types, nuget-package
- Language: C#
- Homepage:
- Size: 111 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MimeTypes
[![.NET CI/CD Workflow](https://github.com/frankhaugen/Frank.MimeTypes/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/frankhaugen/Frank.MimeTypes/actions/workflows/main.yml)
This library provides a simple way to get the mime type of a file extension or the file extension of a mime type.
## Installation
### .NET CLI
```bash
dotnet add package Frank.MimeTypes
```### Package Manager
```bash
Install-Package Frank.MimeTypes
```### Package Reference
```xml
```
## Usage
### Namespace
```csharp
using Frank.MimeTypes;
```### Get mime type from file extension
```csharp
var mimeType = MimeTypes.GetMimeType("txt");
```### Get file extension from mime type
```csharp
var fileExtension = MimeTypes.GetFileExtension("text/plain");
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details