mime

1.0.0

A MIME type library written for Swift
BinaryBirds/swift-mime

What's New

Initial release

2023-03-08T11:36:42Z

Very first public version

swift-mime

The swift-mime library can convert file extensions into possible MIME types.

Install command line utility

You can use the command line utility to convert file extensions into file MIME types on the fly.

$ git clone https://github.com/BinaryBirds/swift-mime.git && cd swift-mime
$ make install

$ mime txt 
$ # => text/plain

Library usage

You can use the Swift Package Manager as usual:

.package(url: "https://github.com/binarybirds/swift-mime", from: "1.0.0"),

.product(name: "MIME", package: "mime")

⚠️ Don't forget to add "MIME" to your target as a dependency!

import MIME

let mime = MIME()
let result = mime.getType(for: "txt")

print(result) // => text/plain

Useful resources

Description

  • Swift Tools 5.7.0
View More Packages from this Author

Dependencies

  • None
Last updated: Fri Oct 10 2025 10:04:46 GMT-0900 (Hawaii-Aleutian Daylight Time)