NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #249 most downloaded on npm
Infer the content-type of a request.
Last release 13 days ago
21 Sep 2026
Ships unpredictably
gaps range from 4 weeks to 5.4 years
Most releases are documented
notes for 31 of 41 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
41 releases · first in 2013
This version switches the package to ESM and node >= 22.
This version switches the package to ESM and node >= 22.
Changed:
text/html; charset=utf-8)text/* would return e.g. text/html on match, now it returns the original text/*undefined instead of false on no matchundefined when no input types are definednew TypeIs(["invalid"]), it does not error if the header is invalid)Removed:
mime-types from the package, only has 3 built in "shortcuts" (e.g. json -> application/json)
mime-types.lookup as an option to overrideBefore:
const isText = typeis(req, ['text/*'])After:
const isText = new TypeIs(['text/*']).request(req);If you are upgrading an upstream dependency (e.g. express), and want maximum compatibility, something like this can help with compatibility for the extension aliases:
import * as mimeTypes from 'mime-types';
import { TypeIs, DEFAULT_LOOKUP } from 'type-is';
function lookup (value) {
return mimeTypes.lookup(value) || DEFAULT_LOOKUP(value);
}
req.is = function (types) {
const matcher = new TypeIs(types, { lookup });
return matcher.request(this);
};However the returned string has changed. Backward compatibility with the old string is achievable by mimicking the old behavior -- parse the MIME type yourself (example) and use the matcher.contentType method. This is not recommended though.
One column per quarter.
Upgraded to content-type@2 for faster parsing
Changed
content-type@2 for faster parsingReplace deprecated String.prototype.substr() by @CommanderRoot in #50
Full Changelog: 2.0.0...2.0.1
README changes by @Yash-Singh1 in #48
Full Changelog: 1.6.18...2.0.0
Fix regression passing request object to typeis.is
typeis.isAdd Apple file extensions from IANA
.csl to application/vnd.citationstyles.style+xml.es to application/ecmascript.nq to application/n-quads.nt to application/n-triples.owl to application/rdf+xml.siv and .sieve to application/sieveimage/* typesmodel/* typestext/mdx with extension .mdxthrow on invalid typeAdd application/raml+yaml with extension .raml
application/raml+yaml with extension .ramlapplication/wasm with extension .wasmtext/shex with extension .shexmessage/* types.mjs to application/javascript.wadl to application/vnd.sun.wadl+xml.gz to application/gzip.md and .markdown to be text/markdowntext/hjson to registered application/hjsondeps: mime-types@~2.1.15 Add new mime types
deps: mime-types@~2.1.13 Add new mime types
deps: mime-types@~2.1.11 Add new mime types
Fix extension of application/dash+xml
application/dash+xmlaudio/mp4- deps: mime-types@~2.1.9 - Add new mime types
- deps: mime-types@~2.1.8 - Add new mime types
- deps: mime-types@~2.1.7 - Add new mime types
- deps: mime-types@~2.1.6 - Add new mime types
Fix type error when given invalid type to match against
- deps: mime-types@~2.1.4 - Add new mime types
- deps: mime-types@~2.1.3 - Add new mime types
perf: remove argument reassignment
perf: remove bitwise operations
- deps: mime-types@~2.0.11 - Add new mime types
- deps: mime-types@~2.0.10 - Add new mime types
fix false-positives in hasBody Transfer-Encoding check
hasBody Transfer-Encoding check*/*)- fix argument reassignment - deps: mime-types@~2.0.9 - Add new mime types
- deps: mime-types@~2.0.8 - Add new mime types
Fix various invalid MIME type entries
- deps: mime-types@~2.0.4 - Add new mime types - deps: mime-db@~1.3.0
- deps: mime-types@~2.0.3 - Add new mime types - deps: mime-db@~1.2.0
- deps: mime-types@~2.0.2 - Add new mime types - deps: mime-db@~1.1.0
- Support Node.js 0.6 - deps: media-typer@0.3.0 - deps: mime-types@~2.0.1 - Support Node.js 0.6
fix hasbody to be true for content-length: 0
hasbody to be true for content-length: 0Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →