gabriel-vasile/mimetype
A Go package for media type and file extension detection, based on magic numbers observed · 2026-08-28
Health v2 · maintenance only
92/100
- Activity 97
- Release rhythm 82
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-02. Adoption (stars, forks) is never an input.
- gap_med: 50
- age_days: 2984
- days_rel: 41
- days_push: 23
- n_releases_24m: 10
Adoption not part of the score
2012 stars · 200 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded
A pure-Go library for detecting MIME types and file extensions from file content using magic numbers. It is goroutine-safe, dependency-free, extensible with custom formats, and can differentiate text from binary files.
Use cases
- detect the mime type of an uploaded file in Go
- validate file uploads by content instead of extension
- get a file extension from raw bytes
- sniff whether a file is text or binary
- detect file type without libmagic or C bindings
- identify document formats like Office files from their signatures
When to choose
- you need content-based file type detection in a Go program
- you want a dependency-free, concurrency-safe alternative to libmagic
- you need to validate uploads whose declared Content-Type may be wrong
- you need to extend detection with custom file formats
When to avoid
- metadata is already available from the protocol, e.g. HTTP or SMTP Content-Type headers
- you need detection of formats whose signatures lie far into large files and cannot afford reading more bytes
- you are not working in Go
Facets
library · maturity stable
parser developer-tools files developer-tools web-development go cross-platform mime-detection magic-numbers file-type-sniffing file-extensions content-type
5 sources
- readme: https://github.com/gabriel-vasile/mimetype · fetched 2026-08-28 · 2144f7bd9c87
- homepage: https://pkg.go.dev/github.com/gabriel-vasile/mimetype#pkg-overview · fetched 2026-08-29 · afcfe79b3879
- site_page: https://pkg.go.dev/about · fetched 2026-08-29 · 757852027879
- site_page: https://pkg.go.dev/github.com/gabriel-vasile/mimetype · fetched 2026-08-29 · afcfe79b3879
- site_page: https://go.dev/project · fetched 2026-08-29 · d5ca00bb378b
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| gabriel-vasile/mimetype | main | 92 |
For agents
markdown · JSON · MCP: product_card(name="gabriel-vasile/mimetype")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem