Back to Explore

jshttp/media-typer

GitHub
1 updates · last 90 days1 watchersOpen source

Last release:

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 repository shows recent activity, with upstream pushes as recently as 2026-06-01 and a tagged update (v2.0.0) on 2026-05-27, indicating the source is actively maintained.
  • Apparent update cadence is relatively frequent recently (about weekly between 2026-05-27 and 2026-06-01), though the longer-term history includes long gaps (for example, major updates in 2019 and then the next major update in 2026).

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v2.0.0

    Release 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.

    BreakingFeatures
  • v1.1.0

    Release 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.

    Features
  • v1.0.2

    Release 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

    v1.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).

    Breaking
  • v1.0.0

    v1.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).

    Breaking
  • v0.3.0

    Release 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.

    BreakingFeatures
  • v0.2.0

    This 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.

    Features
  • v0.1.0

    Release 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.

    Features
  • v0.0.0

    This 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.