# mime (npm)

> MIME type lookup for JavaScript, by extension or type

Source: https://talira.ai/catalog/mime-npm-8eejtqnz
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / file type detection](https://talira.ai/categories/libraries/file-type-detection), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Robert Kieffer](https://talira.ai/orgs/broofa.md)

mime is a JavaScript API for MIME type information covering every type in mime-db: look up a type by file extension (`getType('txt')`) or an extension by type (`getExtension('text/plain')`), and define custom mappings. It ships TypeScript types, and `mime/lite` is a smaller drop-in without unofficial vendor and experimental types. Version 4 is ESM-only. It's by Robert Kieffer.

## Links

- GitHub: https://github.com/broofa/mime

## Problems it solves

- get the MIME type for a file extension in JavaScript
- set the Content-Type header from a filename in Node
- find the file extension for a MIME type in JavaScript

## Features

- all mime-db types
- type from extension and extension from type
- custom type definitions
- built-in TypeScript types
- mime/lite without unofficial types

## Trust

Overall: 0.46 out of 1.
Signals: maintenance 0.50, adoption 0.67, momentum 0.33, community 0.71, backing 0.30, extensibility 0.00.

- last commit 31 days ago
- 8 commits in the last 90 days
- latest release v4.1.2 33 days ago
- 2.4k GitHub stars
- 60 contributors
- accepts sponsorship (Github)
- backed by Robert Kieffer

## Sources

[^1]: https://github.com/broofa/mime/blob/main/LICENSE (checked 29 Nov 2026)
