{"id":17001668,"url":"https://github.com/shresht7/http-status-codes","last_synced_at":"2025-03-22T08:48:26.463Z","repository":{"id":39634767,"uuid":"450010673","full_name":"Shresht7/HTTP-Status-Codes","owner":"Shresht7","description":"TypeScript enum and reference for HTTP status codes.","archived":false,"fork":false,"pushed_at":"2025-01-21T20:39:38.000Z","size":117,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-27T09:09:39.613Z","etag":null,"topics":["http-status-codes"],"latest_commit_sha":null,"homepage":"","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/Shresht7.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":"2022-01-20T08:17:12.000Z","updated_at":"2024-09-29T09:28:13.000Z","dependencies_parsed_at":"2024-11-28T18:32:12.238Z","dependency_job_id":"5deb5604-e1b5-4975-bc54-56d1e673dfe8","html_url":"https://github.com/Shresht7/HTTP-Status-Codes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FHTTP-Status-Codes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FHTTP-Status-Codes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FHTTP-Status-Codes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shresht7%2FHTTP-Status-Codes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shresht7","download_url":"https://codeload.github.com/Shresht7/HTTP-Status-Codes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244931586,"owners_count":20534010,"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":["http-status-codes"],"created_at":"2024-10-14T04:25:43.366Z","updated_at":"2025-03-22T08:48:26.419Z","avatar_url":"https://github.com/Shresht7.png","language":"TypeScript","readme":"\u003ch1\u003e HTTP Status Codes\u003c/h1\u003e\n\n\u003ch3\u003e🚧 Work in Progress 🚧\u003c/h3\u003e\n\n\u003c!-- \n## 📦 Import\n\n### Node\n\n```sh\nTODO: npm install \u003cpackage-name\u003e\n```\n\n```ts\nimport { Status, Code } from 'http-status-codes'\n```\n\n### Deno\n\n```ts\nimport { Status, Code } from 'https://.../HTTP-Status-Codes/deno/mod.ts'\n```\n--\u003e\n\n## 📖 Usage\n\n```ts\nimport { Status, Code } from 'http-status-code'\n\nStatus.INFORMATION.PROCESSING  //  102\nStatus.SUCCESS.OK              //  200\nStatus.CLIENT_ERROR[404]       //  NOT_FOUND\n\nCode.BAD_GATEWAY               //  502\nCode[200]                      //  OK\n```\n\n### `Status`\n\n| Status Type           | Series | Description                                                     |\n| --------------------- | ------ | --------------------------------------------------------------- |\n| `Status.INFORMATION`  | `1xx`  | The request was received and understood, continuing process     |\n| `Status.SUCCESS`      | `2xx`  | Request was received, understood, and accepted                  |\n| `Status.REDIRECT`     | `3xx`  | Additional action requested from client. Mainly URL Redirection |\n| `Status.CLIENT_ERROR` | `4xx`  | Request cannot be fulfilled due to a client side error          |\n| `Status.SERVER_ERROR` | `5xx`  | Request cannot be fulfilled due to a server side error          |\n\n```ts\nStatus.INFORMATION.PROCESSING   //  102\nStatus.SUCCESS.OK               //  200\nStatus.CLIENT_ERROR[404]        //  NOT_FOUND\n```\n\n### `Code`\n\n```ts\nCode.SWITCHING_PROTOCOLS        //  101\nCode.CREATED                    //  201\nCode.BAD_REQUEST                //  400\nCode[301]                       //  MOVED_PERMANENTLY\n```\n\n### `StatusText`\n\n```ts\nimport { Status, Code, StatusText } from 'http-status-code'\n\nStatusText(Code.CONTINUE)                           //  Continue\nStatusText(Status.INFORMATION.SWITCHING_PROTOCOLS)  //  Switching Protocols\nStatusText(404)                                     //  Not Found\n```\n\n`StatusText` can be given a custom formatter to customize the output string.\n\n```ts\nStatusText(Status.CLIENT_ERROR.NOT_FOUND, (text: string) =\u003e {\n    return `[${Code[text]} - ${text}]: Nothing to see here!`\n})\n//  [404 - NOT_FOUND]: Nothing to see here!\n```\n\n### `Checks`\n\n`isStatus` | `isInformation` | `isSuccess` | `isRedirect` | `isClientError` | `isServerError` | `isError`\n\n```ts\nimport {\n    Code,\n    Status,\n    isStatus,\n    isInformation,\n    isSuccess,\n    isRedirect,\n    isClientError,\n    isServerError\n} from 'http-status-code'\n\nisStatus(Status.REDIRECT.MOVED_PERMANENTLY)             //  true\nisStatus(Code.BAD_REQUEST)                              //  true\nisStatus(502)                                           //  true\nisStatus(987)                                           //  false\n\nisInformation(Status.INFORMATION.SWITCHING_PROTOCOLS)   //  true\nisInformation(Code.INTERNAL_SERVER_ERROR)               //  false  \n\nisSuccess(200)                                          //  true\nisSuccess(Code.NOT_FOUND)                               //  false\n\nisRedirect(301)                                         //  true\n\nisClientError(404)                                      //  true\nisServerError(404)                                      //  false\nisError(404)                                            //  true\n```\n\n---\n\n## 📑License\n\n\u003e [MIT License](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fhttp-status-codes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshresht7%2Fhttp-status-codes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshresht7%2Fhttp-status-codes/lists"}