Back to Explore

prettymuchbryce/http-status-codes

GitHub
1 watchersOpen source

Last release: 9/20/2023

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

  • The source appears to be maintained, with an upstream push recorded on 2024-07-23, and prior versioned updates adding new HTTP status code constants (latest listed update v2.3.0 on 2023-09-20).
  • Update cadence looks irregular and relatively infrequent, with the recent history showing multi-year gaps between tagged updates (v2.2.0 in 2022-01-04, v2.3.0 in 2023-09-20, and v2.1.4 in 2020-09-19).

AI summary generated Today

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

Recent updates

  • v2.3.0

    9/20/2023

    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

    1/4/2022

    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

    9/19/2020

    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

    9/12/2020

    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

    8/24/2020

    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

    8/23/2020

    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

    8/23/2020

    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

    8/23/2020

    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

    6/21/2020

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

    Features