whatwg-mimetype
npmv5.0.0Parses, serializes, and manipulates MIME types, according to the WHATWG MIME Sniffing Standard
Safe to adopt
Yes — whatwg-mimetype scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 233 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- BMaintenance: grade B, Good.
Last published 233 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 42 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 6 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 whatwg-mimetype 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 >=20
- Module format
- CommonJS only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the whatwg-mimetype README.
const { MIMEType } = require("whatwg-mimetype");
const mimeType = new MIMEType(`Text/HTML;Charset="utf-8"`);
console.assert(mimeType.toString() === "text/html;charset=utf-8");
console.assert(mimeType.type === "text");
console.assert(mimeType.subtype === "html");
console.assert(mimeType.essence === "text/html");
console.assert(mimeType.parameters.get("charset") === "utf-8");
mimeType.parameters.set("charset", "windows-1252");
console.assert(mimeType.parameters.get("charset") === "windows-1252");
console.assert(mimeType.toString() === "text/html;charset=windows-1252");whatwg-mimetype 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 |
|---|---|---|---|---|
| whatwg-mimetypethis page | 0 | 3 | MIT | 7 months ago |
| content-type | 201.5M | 6 | MIT | 13 days ago |
| node-fetch | 192.4M | 9 | MIT | 13 days ago |
| undici | 169.8M | 15 | MIT | 13 days ago |
| cross-fetch | 38M | 2 | MIT | 13 days ago |
| http-errors | 169.2M | 7 | MIT | 13 days ago |
Dependencies
Declared by whatwg-mimetype v5.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (5)
Used by
Popular packages that depend on whatwg-mimetype.
The fast, flexible & elegant library for parsing and manipulating HTML and XML.
A JavaScript implementation of many web standards
Happy DOM is a JavaScript implementation of a web browser without its graphical user interface. It includes many web standards from WHATWG DOM and HTML.
Relationship graph
Dependencies (left) and dependents (right) of whatwg-mimetype.
Frequently installed together
Next generation testing framework powered by Vite
TypeScript definitions for whatwg-mimetype
TypeScript definitions for node
UI for Vitest
TypeScript definitions for ws
Encode & decode XML and HTML entities with ease & speed
get dimensions of any image buffer
An HTTP/1.1 client, written from scratch for Node.js
An AST-based pattern checker for JavaScript.
🔎 A simple, tiny and lightweight benchmarking library!
An implementation of the WHATWG URL Standard's URL API and parsing machinery
An evented streaming XML parser in JavaScript
Release history
1 release in the last two years, typically about 222 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 5.0.0latest | 7 months ago | 42 KB | MIT |
| 4.0.0 | 2 years ago | 16 KB | MIT |
| 3.0.0 | 5 years ago | 16 KB | MIT |
| 2.3.0 | 7 years ago | 16 KB | MIT |
| 2.2.0 | 8 years ago | 16 KB | MIT |
| 2.1.0 | 8 years ago | — | MIT |
| 2.0.1 | 8 years ago | — | MIT |
| 2.0.0 | 8 years ago | — | MIT |
Overview
whatwg-mimetype is an npm package that parses, serializes, and manipulates MIME types, according to the WHATWG MIME Sniffing Standard. It has 3 known dependents in the graph. The latest version is 5.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need parses, serializes, and manipulates MIME types, according to the WHATWG MIME Sniffing Standard and value a focused 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
- 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.
Frequently asked questions
Should I use whatwg-mimetype?
Yes — whatwg-mimetype scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 233 days ago.
How do I install whatwg-mimetype?
Run `npm install whatwg-mimetype` to add whatwg-mimetype to your npm project.
What license is whatwg-mimetype released under?
whatwg-mimetype is distributed under the MIT license.
How popular is whatwg-mimetype?
npm does not publish download counts. Within PackageGraph's crawl, 3 known packages depend on whatwg-mimetype.
Is whatwg-mimetype still maintained?
The most recent release of whatwg-mimetype (v5.0.0) was published 7 months ago.
Does whatwg-mimetype run install scripts?
No. whatwg-mimetype does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.