</>PackageGraphPackageGraph

content-type

npmv3.0.0TypeScript

Create 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

22 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

PackageWeekly downloadsDependentsLicenseLast release
content-typethis page191.4M6MIT20 days ago
vary100.2M4MIT1 day ago
etag100M4MIT1 day ago
forwarded92M1MIT1 day ago
whatwg-mimetype03MIT1 day ago
content-disposition02MIT1 day ago

Dependencies

Declared by content-type v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (4)

@borderless/ts-scripts ^0.15.0@vitest/coverage-v8 ^4.1.11typescript ^7.0.2vitest ^4.1.11

Used by

Popular packages that depend on content-type.

Relationship graph

Dependencies (left) and dependents (right) of content-type.

Frequently installed together

Release history

3 releases in the last two years, typically about 451 days apart.

Recent versions of content-type
VersionPublishedSizeLicense
3.0.0latest20 days ago22 KBMIT
2.1.027 days ago23 KBMIT
2.0.04 months ago20 KBMIT
1.0.53 years ago10 KBMIT
1.0.49 years agoMIT
1.0.39 years agoMIT
1.0.210 years agoMIT
1.0.111 years agoMIT
1.0.011 years agoMIT
0.0.113 years agoUnlicense <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

Keywords

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.