type-is
npmv2.1.0Infer the content-type of a request.
Safe to adopt
Yes — type-is scores well across adoption, maintenance, weight, supply chain, and licensing. 130.9M downloads per week and 3 known dependents. Last published 119 days ago. 2 releases in the last 2 years.
- AAdoption: grade A, Excellent.
130.9M downloads per week and 3 known dependents.
- BMaintenance: grade B, Good.
Last published 119 days ago. 2 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 4 transitive packages, about 297 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 type-is 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 type-is, 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 type-is README.
var http = require('http')
var typeis = require('type-is')
http.createServer(function (req, res) {
var istext = typeis(req, ['text/*'])
res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text')
})type-is 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 |
|---|---|---|---|---|
| type-isthis page | 130.9M | 3 | MIT | 3 months ago |
| type-check | 0 | 2 | MIT | 1 day ago |
| zod | 246.7M | 13 | MIT | 1 day ago |
| is-plain-obj | 112.9M | 1 | MIT | 1 day ago |
| type-detect | 44.3M | 1 | MIT | 1 day ago |
| mime-db | 0 | 2 | MIT | 1 day ago |
Dependencies
Declared by type-is v2.1.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (9)
Used by
Popular packages that depend on type-is.
Relationship graph
Dependencies (left) and dependents (right) of type-is.
Frequently installed together
Create and parse HTTP Content-Type header
Create HTTP error objects
Execute a callback when a request closes, finishes, or errors
The ultimate javascript content-type utility.
An AST-based pattern checker for JavaScript.
Encode a URL to a percent-encoded form, excluding already-encoded sequences
Manipulate the HTTP Vary header
Create and parse Content-Disposition header
HTTP response freshness testing
Higher-level content negotiation
Lightweight debugging utility for Node.js and the browser
A querystring parser that supports nesting and arrays, with a depth limit
Release history
2 releases in the last two years, typically about 59 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 2.1.0latest | 3 months ago | 21 KB | MIT |
| 2.0.1 | 1 year ago | 21 KB | MIT |
| 2.0.0 | 2 years ago | 21 KB | MIT |
| 1.6.18 | 7 years ago | 18 KB | MIT |
| 1.6.17 | 7 years ago | 17 KB | MIT |
| 1.6.16 | 8 years ago | 16 KB | MIT |
| 1.6.15 | 9 years ago | — | MIT |
| 1.6.14 | 9 years ago | — | MIT |
| 1.6.13 | 10 years ago | — | MIT |
| 1.6.12 | 10 years ago | — | MIT |
| 1.6.11 | 10 years ago | — | MIT |
| 1.6.10 | 10 years ago | — | MIT |
| 1.6.9 | 11 years ago | — | MIT |
| 1.6.8 | 11 years ago | — | MIT |
| 1.6.7 | 11 years ago | — | MIT |
Overview
type-is is an npm package that infer the content-type of a request. It is extremely widely used, with about 130.9M downloads per week and 3 known dependents in the graph. The latest version is 2.1.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need infer the content-type of a request 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 (130.9M 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 type-is?
Yes — type-is scores well across adoption, maintenance, weight, supply chain, and licensing. 130.9M downloads per week and 3 known dependents. Last published 119 days ago. 2 releases in the last 2 years.
How do I install type-is?
Run `npm install type-is` to add type-is to your npm project.
How many dependencies does type-is have?
type-is declares 12 direct dependencies and pulls in 4 packages in total once its runtime tree is resolved totalling about 297 KB on disk.
What license is type-is released under?
type-is is distributed under the MIT license.
How popular is type-is?
type-is has approximately 130,886,489 downloads per week and 3 known dependent packages.
Is type-is still maintained?
The most recent release of type-is (v2.1.0) was published 3 months ago.
Does type-is run install scripts?
No. type-is does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.