mime-types
npmv3.0.2The ultimate javascript content-type utility.
Safe to adopt
Yes — mime-types scores well across adoption, maintenance, weight, supply chain, and licensing. 185.3M downloads per week and 9 known dependents. Last published 293 days ago. 2 releases in the last 2 years.
- AAdoption: grade A, Excellent.
185.3M downloads per week and 9 known dependents.
- BMaintenance: grade B, Good.
Last published 293 days ago. 2 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 1 transitive package, about 243 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 5 maintainers, and a contained dependency surface.
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding mime-types to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Licenses in the dependency tree
Every license you inherit by installing mime-types, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- node >=18
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the mime-types README.
var mime = require('mime-types')mime-types vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| mime-typesthis page | 185.3M | 9 | MIT | 9 months ago |
| mime-db | 0 | 2 | MIT | 1 day ago |
| type-fest | 337.8M | 6 | (MIT OR CC0-1.0) | 1 day ago |
| csstype | 142.8M | 2 | MIT | 1 day ago |
| mime | 136.4M | 6 | MIT | 1 day ago |
| expect-type | 78.4M | 8 | Apache-2.0 | 1 day ago |
Dependencies
Declared by mime-types v3.0.2. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (9)
Used by
Popular packages that depend on mime-types.
A comprehensive library for mime-type mapping
Infer the content-type of a request.
Better streaming static file server with Range and conditional-GET support
Fast, unopinionated, minimalist web framework
Simplified HTTP request client.
Koa web app framework
A library to create readable "multipart/form-data" streams. Can be used to submit forms and file uploads to other web applications.
🚇 The JavaScript bundler for React Native.
Higher-level content negotiation
Relationship graph
Dependencies (left) and dependents (right) of mime-types.
Frequently installed together
An AST-based pattern checker for JavaScript.
Create and parse HTTP Content-Type header
Create HTTP error objects
Encode a URL to a percent-encoded form, excluding already-encoded sequences
Execute a callback when a request closes, finishes, or errors
HTTP response freshness testing
Escape string for use in HTML
Lightweight debugging utility for Node.js and the browser
HTTP status utility
Higher-level content negotiation
Infer the content-type of a request.
Manipulate the HTTP Vary header
Release history
2 releases in the last two years, typically about 62 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.0.2latest | 9 months ago | 22 KB | MIT |
| 3.0.1 | 1 year ago | 22 KB | MIT |
| 3.0.0 | 2 years ago | 22 KB | MIT |
| 2.1.35 | 4 years ago | 18 KB | MIT |
| 2.1.34 | 4 years ago | 18 KB | MIT |
| 2.1.33 | 5 years ago | 18 KB | MIT |
| 2.1.32 | 5 years ago | 17 KB | MIT |
| 2.1.31 | 5 years ago | 17 KB | MIT |
| 2.1.30 | 5 years ago | 17 KB | MIT |
| 2.1.29 | 5 years ago | 17 KB | MIT |
| 2.1.28 | 5 years ago | 17 KB | MIT |
| 2.1.27 | 6 years ago | 16 KB | MIT |
| 2.1.26 | 6 years ago | 16 KB | MIT |
| 2.1.25 | 6 years ago | 16 KB | MIT |
| 2.1.24 | 7 years ago | 15 KB | MIT |
Overview
mime-types is an npm package that the ultimate javascript content-type utility. It is extremely widely used, with about 185.3M downloads per week and 9 known dependents in the graph. The latest version is 3.0.2, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need the ultimate javascript content-type utility and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (185.3M weekly downloads).
- Clear open-source license (MIT).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Funding
Frequently asked questions
Should I use mime-types?
Yes — mime-types scores well across adoption, maintenance, weight, supply chain, and licensing. 185.3M downloads per week and 9 known dependents. Last published 293 days ago. 2 releases in the last 2 years.
How do I install mime-types?
Run `npm install mime-types` to add mime-types to your npm project.
How many dependencies does mime-types have?
mime-types declares 10 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 243 KB on disk.
What license is mime-types released under?
mime-types is distributed under the MIT license.
How popular is mime-types?
mime-types has approximately 185,292,782 downloads per week and 9 known dependent packages.
Is mime-types still maintained?
The most recent release of mime-types (v3.0.2) was published 9 months ago.
Does mime-types run install scripts?
No. mime-types does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.