whatwg-mimetype
5.0.0 · 20 Jan 2026MIT220.3M / weekRepositoryHomepagenpmAtom feed
8 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
- 5.x · latest line
5.0.0
20 Jan 2026Node.js v20 is now the minimum supported version.
Node.js v20 is now the minimum supported version.
The
MIMETypeclass has moved from being the default export to being a named export.Added MIME sniffing functionality, via the
computedMIMETypeexport.Removed the raw parsing/serialization APIs.
- 4.x
4.0.0
11 Nov 2023Node.js v18 is now the minimum supported version.
- 3.x
3.0.0
18 Sep 2021Node.js v12 is now the minimum supported version.
Node.js v12 is now the minimum supported version.
Changed the semantics of the
isJavaScript()method to allow parameters by default, like the other testing functions and matching the spec definition of JavaScript MIME type. Now you can prohibit parameters by usingisJavaScript({ prohibitParameters: true }).- 2.x
2.3.0
20 Nov 2018Spec update: use HTTP whitespace instead of ASCII whitespace while parsing, per 126286a. In practice this means U+000C FF characters are no longer treated specially in parsing.
2.1.0
4 Feb 2018Added static
MIMEType.parse()factory, to better serve cases where you are parsing unrestricted input strings.Added static
MIMEType.parse()factory, to better serve cases where you are parsing unrestricted input strings.Added an
isJavaScript({ allowParameters })method for checking if a MIME type is a JavaScript MIME type. (@bmeck)2.0.0
10 Dec 2017Renamed the package from "content-type-parser" to "whatwg-mimetype", as MIME type is the more general concept, and this is now implementing part of the WHATWG MIME Sniffing Standard.
Renamed the package from "content-type-parser" to "whatwg-mimetype", as MIME type is the more general concept, and this is now implementing part of the WHATWG MIME Sniffing Standard.
Replaced the parser and serializer with the newly-specified one from whatwg/mimesniff@cc81ec4.
Overhauled the API to more or less match what is proposed in whatwg/mimesniff#43. Notably, the invariants of the MIME type model are now maintained more aggressively, and the parameters exist on a separate Map-like data structure. Also removed the isText() method, as it's much less interesting than the other two.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.