Back to Explore

jshttp/content-type

GitHub
1 updates · last 90 days1 watchersOpen source

Last release:

This JavaScript/Node.js library helps you create, parse, and format HTTP Content-Type headers. It provides functions to parse a Content-Type string into a media type and parameters, and to format an object back into a header value, which is useful when handling HTTP requests and responses.

Project status

  • The repository appears actively maintained today, with a very recent upstream push on 2026-06-01 and the latest tagged update on 2026-05-11 (v2.0.0).
  • Update cadence is uneven historically, but recent activity is frequent, with a major update in 2026 followed by a long gap since the previous tagged update in 2023 (v1.0.5).

AI summary generated

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

Recent updates

  • v2.0.0

    v2.0.0 is a major rewrite of the library (ported to TypeScript) focused on performance (reported as about 3x faster) and on making `parse` lenient. The documented behavior change is that `parse` no longer throws on invalid input, and a new `options.parameters` flag allows skipping parameter parsing.

    Features
  • v1.0.5

    Release 1.0.5 primarily targets performance in the `contentType.parse` implementation by avoiding unnecessary value escaping work when parsing quoted parameters. The code diff also includes substantial development and CI tooling updates (ESLint, test coverage tooling, GitHub Actions vs Travis), though those are not mentioned in the release notes.

  • v1.0.4

    Release v1.0.4 makes a targeted performance change to the Content-Type parsing logic. Specifically, it avoids running the parameter parsing regular expression when the header contains no parameters.

  • v1.0.3

    v1.0.3 is a small refactor release focused on performance, specifically removing argument reassignment. The main production code changes are in parsing/formatting internals of the HTTP Content-Type header.

  • v1.0.2

    Release 1.0.2 is described as a performance improvement by enabling JavaScript strict mode. The runtime code change is minimal, adding 'use strict' to index.js.

  • v1.0.1

    Release v1.0.1 primarily improves the error message thrown when `contentType.parse` is given req/res-like objects missing a `Content-Type` header. The code change specifically adjusts the validation path for object inputs and the related unit test expectations.

  • v1.0.0

    Release 1.0.0 is an initial implementation, derived from media-typer@0.3.0. No additional features, fixes, security updates, or migration guidance are described in the release notes.