Node.js module that parses and formats RFC 6838 media type strings into components like type, subtype, and optional suffix, and can normalize them back into a canonical form. Useful for working with media types in Node applications, with helpers to parse, format, and validate media type strings.
Project status
- The repo shows recent activity, with the latest upstream push on 2026-06-01 and a significant update (v2.0.0) on 2026-05-27, suggesting it is actively maintained at least recently.
- Update cadence appears irregular, with a long gap between 2019 (v1.1.0, v1.0.2) and a new major update in 2026 (v2.0.0), then follow-on activity very close to that major update (latest push a few days later).
AI summary generated Today
Recent updates
v2.0.0
1 week agoRelease v2.0.0 is a major version that switches the package to ESM-only delivery and introduces TypeScript typings. The codebase is rewritten from the original CommonJS implementation to a TypeScript module with updated validation logic and a new test setup.
BreakingFeaturesv1.1.0
4/25/2019Release v1.1.0 adds a new `typer.test(string)` API for validating whether a media type string matches the existing RFC 6838-compatible `TYPE_REGEXP`. The release notes mention only this new function, and the code diff largely matches that scope.
Featuresv1.0.2
4/19/2019Release v1.0.2 is primarily described as a documentation fix to the JSDoc for the `parse` function. However, the diff also includes changes to CI configuration, README wording about thrown `TypeError`s, and several devDependency version bumps.
v1.0.1
10/21/2018v1.0.1 makes a small change to the MediaType class by removing an instance property named `parameters`. Release notes document this behavior change, and the code diff matches it exactly. The remaining changes are documentation and metadata updates (README badge URLs, HISTORY entry, and package version).
Breakingv1.0.0
10/21/2018v1.0.0 is a major version that re-centers media-typer on RFC 6838, removing support for parsing media-type parameters and the convenience overloads that accepted req/res-like objects. It also updates runtime requirements (Node >= 0.8) and includes some internal performance-related refactors (strict mode, and a class-based object creation approach).
Breakingv0.3.0
1/31/2015Release v0.3.0 updates the project to support Node.js 0.6 and makes the `typer.parse()` parser stricter by throwing when it encounters an invalid parameter format in a media type string. It also updates test and CI configuration to run under the older Node version.
BreakingFeaturesv0.2.0
6/18/2014This release adds a new `typer.format(obj)` API for turning a structured media type object into a valid `type/subtype[+suffix][; params]` string. The README and tests were updated accordingly, and `package.json` was bumped to v0.2.0.
Featuresv0.1.0
6/18/2014Release v0.1.0 extends media-typer's `parse` function to accept req/res-like objects in addition to strings, extracting the `content-type` header. It also relaxes the media type parsing regex to tolerate extra LWS (whitespace) around the type/subtype portion when parameters follow.
Featuresv0.0.0
6/13/2014This release is the very first implementation of the project at version v0.0.0, with no additional details provided in the release notes. There are no documented features, bug fixes, security updates, or migration steps beyond stating it is an initial release.