mime
Version, currently master branch1 version
- master branchlatestJul 5, 2016
github.com/Rinkana/Crystal-MimeTypes
An module that allows you to get mimetypes in crystal
3 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
mime:
github: Rinkana/Crystal-MimeTypes
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
- no constraint declared
- License
- MIT
- Author
- Max Berends
Dependencies
This version declares no dependencies.
README
mime
This is an mime type lib for Crystal. This library not only uses the extension but when given a file object it will also try to detect the mime type based on the leading bytes.
Installation
Add this to your application's shard.yml:
dependencies:
mime:
github: Rinkana/Crystal-MimeTypes
Usage
require "mime"
#Get a mime type from a file. Will return Mime::MimeType if found. Nil if not.
mime_type = Mime.from_file(File.open(File.join(__DIR__, "test.jpg")))
#Get a mime type from an extension only. Please note that the leading dot needs to be absent.
mime_type = Mime.from_extension("jpg")
Contributing
- Fork it ( https://github.com/Rinkana/Crystal-MimeTypes/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- Rinkana - creator, maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Jul 5, 2016
- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/Rinkana/Crystal-MimeTypes
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1