{"id":13479470,"url":"https://github.com/prettymuchbryce/http-status-codes","last_synced_at":"2025-05-14T02:05:58.558Z","repository":{"id":37663429,"uuid":"9943625","full_name":"prettymuchbryce/http-status-codes","owner":"prettymuchbryce","description":"Constants enumerating the HTTP status codes. All status codes defined in RFC1945 (HTTP/1.0, RFC2616 (HTTP/1.1), and RFC2518 (WebDAV) are supported.","archived":false,"fork":false,"pushed_at":"2024-07-23T17:07:48.000Z","size":201,"stargazers_count":1072,"open_issues_count":32,"forks_count":105,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-10T01:45:14.742Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettymuchbryce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-05-08T18:56:39.000Z","updated_at":"2025-05-10T01:06:03.000Z","dependencies_parsed_at":"2024-06-18T11:13:23.477Z","dependency_job_id":"54ef4c61-fa25-4a3f-b62a-62a1bdaaeded","html_url":"https://github.com/prettymuchbryce/http-status-codes","commit_stats":{"total_commits":71,"total_committers":16,"mean_commits":4.4375,"dds":0.4225352112676056,"last_synced_commit":"c840bc674ab043551b87194d1ebb5415f222abbe"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fhttp-status-codes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fhttp-status-codes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fhttp-status-codes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Fhttp-status-codes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettymuchbryce","download_url":"https://codeload.github.com/prettymuchbryce/http-status-codes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052692,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T16:02:16.927Z","updated_at":"2025-05-14T02:05:53.546Z","avatar_url":"https://github.com/prettymuchbryce.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# http-status-codes\n\nConstants enumerating the HTTP status codes. Based on the [Java Apache HttpStatus API](http://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/HttpStatus.html).\n\nAll status codes defined in the following RFCs are supported:\n* RFC1945 (HTTP/1.0)\n* RFC2616 (HTTP/1.1)\n* RFC7231 (HTTP/1.1: Semantics and Content)\n* RFC2518 (WebDAV)\n* RFC6585 (Additional HTTP Status Codes)\n* RFC7538 (Permanent Redirect)\n* RFC8297 (An HTTP Status Code for Indicating Hints)\n\nTypeScript or JavaScript. Completely library agnostic. No dependencies.\n\n## Installation\n\n```console\nnpm install http-status-codes --save\n```\n\n## Usage (express 4.x)\n\n```typescript\nimport {\n\tReasonPhrases,\n\tStatusCodes,\n\tgetReasonPhrase,\n\tgetStatusCode,\n} from 'http-status-codes';\n\nresponse\n\t.status(StatusCodes.OK)\n\t.send(ReasonPhrases.OK);\n\nresponse\n\t.status(StatusCodes.INTERNAL_SERVER_ERROR)\n\t.send({\n\t\terror: getReasonPhrase(StatusCodes.INTERNAL_SERVER_ERROR)\n\t});\n\nresponse\n\t.status(getStatusCode('Internal Server Error'))\n\t.send({\n\t\terror: 'Internal Server Error'\n\t});\n```\n\n## Codes\n\n| Code | Constant                        | Reason Phrase                   |\n| ---- | ------------------------------- | ------------------------------- |\n| 100  | CONTINUE                        | Continue                        |\n| 101  | SWITCHING_PROTOCOLS             | Switching Protocols             |\n| 102  | PROCESSING                      | Processing                      |\n| 103  | EARLY_HINTS                     | Early Hints                     |\n| 200  | OK                              | OK                              |\n| 201  | CREATED                         | Created                         |\n| 202  | ACCEPTED                        | Accepted                        |\n| 203  | NON_AUTHORITATIVE_INFORMATION   | Non Authoritative Information   |\n| 204  | NO_CONTENT                      | No Content                      |\n| 205  | RESET_CONTENT                   | Reset Content                   |\n| 206  | PARTIAL_CONTENT                 | Partial Content                 |\n| 207  | MULTI_STATUS                    | Multi-Status                    |\n| 300  | MULTIPLE_CHOICES                | Multiple Choices                |\n| 301  | MOVED_PERMANENTLY               | Moved Permanently               |\n| 302  | MOVED_TEMPORARILY               | Moved Temporarily               |\n| 303  | SEE_OTHER                       | See Other                       |\n| 304  | NOT_MODIFIED                    | Not Modified                    |\n| 305  | USE_PROXY                       | Use Proxy                       |\n| 307  | TEMPORARY_REDIRECT              | Temporary Redirect              |\n| 308  | PERMANENT_REDIRECT              | Permanent Redirect              |\n| 400  | BAD_REQUEST                     | Bad Request                     |\n| 401  | UNAUTHORIZED                    | Unauthorized                    |\n| 402  | PAYMENT_REQUIRED                | Payment Required                |\n| 403  | FORBIDDEN                       | Forbidden                       |\n| 404  | NOT_FOUND                       | Not Found                       |\n| 405  | METHOD_NOT_ALLOWED              | Method Not Allowed              |\n| 406  | NOT_ACCEPTABLE                  | Not Acceptable                  |\n| 407  | PROXY_AUTHENTICATION_REQUIRED   | Proxy Authentication Required   |\n| 408  | REQUEST_TIMEOUT                 | Request Timeout                 |\n| 409  | CONFLICT                        | Conflict                        |\n| 410  | GONE                            | Gone                            |\n| 411  | LENGTH_REQUIRED                 | Length Required                 |\n| 412  | PRECONDITION_FAILED             | Precondition Failed             |\n| 413  | REQUEST_TOO_LONG                | Request Entity Too Large        |\n| 414  | REQUEST_URI_TOO_LONG            | Request-URI Too Long            |\n| 415  | UNSUPPORTED_MEDIA_TYPE          | Unsupported Media Type          |\n| 416  | REQUESTED_RANGE_NOT_SATISFIABLE | Requested Range Not Satisfiable |\n| 417  | EXPECTATION_FAILED              | Expectation Failed              |\n| 418  | IM_A_TEAPOT                     | I'm a teapot                    |\n| 419  | INSUFFICIENT_SPACE_ON_RESOURCE  | Insufficient Space on Resource  |\n| 420  | METHOD_FAILURE                  | Method Failure                  |\n| 421  | MISDIRECTED_REQUEST             | Misdirected Request             |\n| 422  | UNPROCESSABLE_ENTITY            | Unprocessable Entity            |\n| 423  | LOCKED                          | Locked                          |\n| 424  | FAILED_DEPENDENCY               | Failed Dependency               |\n| 426  | UPGRADE_REQUIRED                | Upgrade Required                |\n| 428  | PRECONDITION_REQUIRED           | Precondition Required           |\n| 429  | TOO_MANY_REQUESTS               | Too Many Requests               |\n| 431  | REQUEST_HEADER_FIELDS_TOO_LARGE | Request Header Fields Too Large |\n| 451  | UNAVAILABLE_FOR_LEGAL_REASONS   | Unavailable For Legal Reasons   |\n| 500  | INTERNAL_SERVER_ERROR           | Internal Server Error           |\n| 501  | NOT_IMPLEMENTED                 | Not Implemented                 |\n| 502  | BAD_GATEWAY                     | Bad Gateway                     |\n| 503  | SERVICE_UNAVAILABLE             | Service Unavailable             |\n| 504  | GATEWAY_TIMEOUT                 | Gateway Timeout                 |\n| 505  | HTTP_VERSION_NOT_SUPPORTED      | HTTP Version Not Supported      |\n| 507  | INSUFFICIENT_STORAGE            | Insufficient Storage            |\n| 511  | NETWORK_AUTHENTICATION_REQUIRED | Network Authentication Required |\n\n## Migrating from v1.x.x\n\nhttp-status-codes v2 is mostly backwards compatible with v1. There is a single breaking change and two recommended changes.\n\n#### [Breaking Change] 'Server Error'\n\nThe reason phrase for the status code `500` has been changed from `\"Server Error\"` to `\"Internal Server Error\"`. This is the correct phrase according to RFC7231. If you are migrating from v1, and have code that relies on the result of `getStatusText(500)` or `getReasonPhrase('Server Error')`, then this could affect you.\n\n#### [Non-breaking change] getStatusText renamed getReasonPhrase\n\nThe function `getStatusText` has been renamed to `getReasonPhrase`. The old function is still available, but may be deprecated in a future version. To fix this simply rename instances of `getStatusText()` to `getReasonPhrase()`. The function is otherwise the same as it was before.\n\n#### [Non-breaking change] StatusCodes\n\nIn http-status-codes v1, Status Codes were exported directly from the top-level module. i.e. `HttpStatus.OK`. In v2 all Status Codes live under an object called `StatusCodes`. i.e. `HttpStatus.StatusCodes.OK`. We made this change to cater to TypeScript users who prefer a dedicated value with an enum type. The previous values are still exported, but we won't continue to update them. Please migrate if you're using the old-style imports.\n\n## Proposing a new status code\n\nIf you'd like to propose a new status code, feel free to update \"codes.json\" with the necessary\ninformation and open a pull request. There is no need to modify source code or even this README.\nThis is done automatically by `npm run update-codes`.\n\nIn general, we try to include only codes that have an official RFC and have been approved, however\nexceptions can be made if the code is already in widespread use in the wild.\n\n## Steps to build and publish\n\n```shell\nnpm run update-codes\nnpm run test\nnpm run build\nnpm version [major | minor | patch]\nnpm publish\n```\n\nAfter releasing, please add release notes via GitHub Releases.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Fhttp-status-codes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettymuchbryce%2Fhttp-status-codes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Fhttp-status-codes/lists"}