mimedb
A large Database of MIME types
Summary
| Latest Version | 0.1.5 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-11-21 14:03 |
Tags
Authors
- George Lemon
Installation
nimble install mimedb
choosenim install mimedb
git clone https://github.com/openpeeps/mimedb
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| mimedb | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Dependencies
| Package | Version | Optional |
|---|---|---|
| nim >= | 2.0.0 | No |
| openparser >= | 0.1.2 | No |
Source
| Repository | https://github.com/openpeeps/mimedb |
|---|---|
| Homepage | https://github.com/openpeeps/mimedb |
| Registry Source | nimble_official |
README
A large database of MIME types
for 👑 Nim language
nimble install mimedb
[!NOTE]
This 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.
😍 Key Features
- Large database of MIME types
- Simple API to get MIME type information
- Lightweight and easy to use
Examples
The database loads automatically on import, no setup needed.
import mimedb
import std/options
# Extension to MIME type.
# Extensions work with or without a leading dot (case-insensitive)
assert getMimeType("html") == some("text/html")
assert getMimeType(".html") == some("text/html")
assert getMimeType("PNG") == some("image/png")
assert getMimeType(".png") == some("image/png")
assert getMimeType("unknownext") == none(string)
# Check if an extension or MIME type exists
assert isExtension("html")
assert isExtension(".html")
assert hasMimeType("text/html")
import mimedb
import std/options
# Get full info for a MIME type
let info = getMimeInfo("text/html")
assert info.isSome
assert info.getSource() == mimeSourceIana
assert info.isCompressible() == true
assert info.getExtensions() == some(@["html", "htm", "shtml"])
assert info.hasExtension("html")
assert info.hasExtension(".html") # leading dot also works
import mimedb
import std/options
let zip = getMimeInfo("application/zip")
assert zip.isSome
assert zip.getSource() == mimeSourceIana
assert zip.isCompressible() == false
assert zip.getExtensions() == some(@["zip"])
assert zip.hasExtension(".zip")
let audio = getMimeInfo("audio/mp4")
assert audio.hasExtension("m4a")
assert audio.hasExtension(".m4a")
This package is using the mime-db database.
❤ Contributions & Support
- 🐛 Found a bug? Create a new Issue
- 👋 Wanna help? Fork it!
🎩 License
MIT license. Made by Humans from OpenPeeps.
Copyright OpenPeeps & Contributors — All rights reserved.