content-type
npmv3.0.0TypeScriptCreate and parse HTTP Content-Type header
Safe to adopt
Yes — content-type scores well across adoption, maintenance, weight, supply chain, and licensing. 191.4M downloads per week and 6 known dependents. Last published 20 days ago. 3 releases in the last 2 years.
- AAdoption: grade A, Excellent.
191.4M downloads per week and 6 known dependents.
- AMaintenance: grade A, Excellent.
Last published 20 days ago. 3 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 22 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 3 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 content-type 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.
Compatibility
- Node.js
- node >=22
- Module format
- ESM only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the content-type README.
import * as contentType from "content-type";content-type 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 |
|---|---|---|---|---|
| content-typethis page | 191.4M | 6 | MIT | 20 days ago |
| vary | 100.2M | 4 | MIT | 1 day ago |
| etag | 100M | 4 | MIT | 1 day ago |
| forwarded | 92M | 1 | MIT | 1 day ago |
| whatwg-mimetype | 0 | 3 | MIT | 1 day ago |
| content-disposition | 0 | 2 | MIT | 1 day ago |
Dependencies
Declared by content-type v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (4)
Used by
Popular packages that depend on content-type.
HTTP content negotiation
Infer the content-type of a request.
Node.js body parsing middleware
Fast, unopinionated, minimalist web framework
Koa web app framework
Model Context Protocol implementation for TypeScript
Relationship graph
Dependencies (left) and dependents (right) of content-type.
Frequently installed together
An AST-based pattern checker for JavaScript.
TypeScript-first schema declaration and validation library with static type inference
The ultimate javascript content-type utility.
Create HTTP error objects
Infer the content-type of a request.
Get and validate the raw body of a readable stream.
Execute a callback when a request closes, finishes, or errors
Next generation testing framework powered by Vite
Encode a URL to a percent-encoded form, excluding already-encoded sequences
Prettier is an opinionated code formatter
Manipulate the HTTP Vary header
Fast, unopinionated, minimalist web framework
Release history
3 releases in the last two years, typically about 451 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.0.0latest | 20 days ago | 22 KB | MIT |
| 2.1.0 | 27 days ago | 23 KB | MIT |
| 2.0.0 | 4 months ago | 20 KB | MIT |
| 1.0.5 | 3 years ago | 10 KB | MIT |
| 1.0.4 | 9 years ago | — | MIT |
| 1.0.3 | 9 years ago | — | MIT |
| 1.0.2 | 10 years ago | — | MIT |
| 1.0.1 | 11 years ago | — | MIT |
| 1.0.0 | 11 years ago | — | MIT |
| 0.0.1 | 13 years ago | — | Unlicense <http://unlicense.org/> |
Overview
content-type is an npm package that create and parse HTTP Content-Type header. It is extremely widely used, with about 191.4M downloads per week and 6 known dependents in the graph. The latest version is 3.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need create and parse HTTP Content-Type header and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (191.4M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use content-type?
Yes — content-type scores well across adoption, maintenance, weight, supply chain, and licensing. 191.4M downloads per week and 6 known dependents. Last published 20 days ago. 3 releases in the last 2 years.
How do I install content-type?
Run `npm install content-type` to add content-type to your npm project.
What license is content-type released under?
content-type is distributed under the MIT license.
How popular is content-type?
content-type has approximately 191,423,803 downloads per week and 6 known dependent packages.
Is content-type still maintained?
The most recent release of content-type (v3.0.0) was published 20 days ago.
Does content-type run install scripts?
No. content-type does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.