mime-types
Version, currently 0.1.01 version
- 0.1.0latestApr 16, 2020
github.com/benemohamed/mime-types
mime-types The ultimate content-type utility.
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
mime-types:
github: benemohamed/mime-types
version: ~> 0.1.0Then run:
shards installshard.yml
- Crystal
0.34.0- License
- MIT
- Author
- Mohamed Ben rebia
- Target
shardsfrom src/mime-types.cr
Dependencies
This version declares no dependencies.
README
mime-types
The ultimate content-type utility.
Installation
-
Add the dependency to your
shard.yml:dependencies: mime-types: github: benemohamed/mime-types -
Run
shards install
Usage
require "mime-types"
mime = Mime::Type.new
mime.lookup(path)
lookup = mime.lookup("file.json") # 'application/json'
mime.contentType(type)
contentType = mime.contentType("markdown") # 'text/markdown; charset=utf-8'
mime.extension(type)
extension = mime.extension("application/octet-stream") # 'bin'
type = mime::types
A map of content-types by extension.
extensions = mime::extensions
A map of extensions by content-type.
Development
crystal spec
Contributing
- Fork it (https://github.com/benemohamed/mime-types/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
- Mohamed Ben - creator and maintainer
License
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.1.0- Tagged
- Apr 16, 2020
- Commit
8e826522ef3e- Crystal
0.34.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/benemohamed/mime-types
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1