Back to Explore

prettymuchbryce/http-status-codes

GitHub
1 watchersOpen source

Last release:

Provides TypeScript/JavaScript constants for HTTP status codes and their reason phrases, suitable for use in apps and frameworks like Express. Useful for mapping status codes to standard text (for example, sending `StatusCodes.INTERNAL_SERVER_ERROR` with `getReasonPhrase`) and keeping status code usage consistent with relevant RFCs.

Project status

  • Maintenance status: Repository updates last show v2.3.0 on 2023-09-20, and the last upstream push was 2024-07-23, so as of 2026-06-09 the source appears quiet/dormant rather than actively maintained.
  • Update cadence: Historically there were bursts of changes around 2020 to 2023, but there is a ~2+ year gap from 2024-07-23 to today, with no evidence of ongoing regular updates.

AI summary generated

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

Recent updates

  • v2.3.0

    Release v2.3.0 adds support for the HTTP status codes 103 (Early Hints) and 426 (Upgrade Required), including updates to the generated enums and lookup maps. The release notes only mention these two additions, but the code diff shows the status-code generation output was also regenerated with a different ordering strategy, causing broader changes to existing enum members and their JSDoc content.

    Features
  • v2.2.0

    Release v2.2.0 adds support for HTTP status code 421, MISDIRECTED_REQUEST. The change propagates through the package’s enums, reason phrase mappings, and the generated codes.json/README tables.

    Features
  • v2.1.4

    Version v2.1.4 refactors the library to improve tree-shaking by splitting previously bundled generated code into smaller modules and re-exporting from the package entrypoint. The release notes claim this is non-breaking and primarily targets reduced bundle/file size for consumers who import only a subset of exports.

  • v2.1.3

    Release v2.1.3 updates http-status-codes with a fix intended for React Native compatibility of the CommonJS build and improves tree-shaking behavior. The release notes mention two changes: repairing the common.js bundle for React Native and marking the module as side-effect free.

  • 2.1.2

    Release 2.1.2 adds browser-friendly ESM output and introduces a default export alongside existing named exports. It specifically addresses issue #56 and adds a default export for backwards compatibility with v1.

    Features
  • 2.1.1

    Release 2.1.1 updates the build process for the package's TypeScript declaration files. The documented intent is to fix a bug in how the TypeScript definitions were being generated.

  • 2.1.0

    Version 2.1.0 adds the HTTP status code 451, Unavailable For Legal Reasons, including its enum constant and reason-phrase mappings. The release notes only mention this new status code.

    Features
  • v2.0.0

    http-status-codes v2.0.0 is a major rewrite of the library in TypeScript, introducing generated enums for status codes and reason phrases, plus new helper functions. It also changes the 500 reason phrase to align with RFC7231 and updates the public API naming to be more consistent.

    BreakingFeatures
  • v1.4.0

    Release v1.4.0 adds a new `getStatusCode` function. No other changes, bug fixes, or compatibility impacts are mentioned in the release notes.

    Features