{"id":43274580,"url":"https://github.com/dev-rashedin/http-status-toolkit","last_synced_at":"2026-02-01T16:14:07.571Z","repository":{"id":301832852,"uuid":"1010435731","full_name":"dev-rashedin/http-status-toolkit","owner":"dev-rashedin","description":"Lightweight, fully typed TypeScript utility for HTTP status codes, with enums, categorized utilities, and helper functions to improve developer experience.","archived":false,"fork":false,"pushed_at":"2025-08-20T06:57:26.000Z","size":505,"stargazers_count":24,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-24T18:55:08.324Z","etag":null,"topics":["dx","http","status-codes","typescript"],"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/dev-rashedin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-06-29T04:14:23.000Z","updated_at":"2025-10-24T11:42:18.000Z","dependencies_parsed_at":"2025-07-04T13:45:13.855Z","dependency_job_id":null,"html_url":"https://github.com/dev-rashedin/http-status-toolkit","commit_stats":null,"previous_names":["rashedin-063/http-status-toolkit","dev-rashedin/http-status-toolkit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dev-rashedin/http-status-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-rashedin%2Fhttp-status-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-rashedin%2Fhttp-status-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-rashedin%2Fhttp-status-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-rashedin%2Fhttp-status-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dev-rashedin","download_url":"https://codeload.github.com/dev-rashedin/http-status-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dev-rashedin%2Fhttp-status-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28981893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T15:35:50.179Z","status":"ssl_error","status_checked_at":"2026-02-01T15:35:38.075Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dx","http","status-codes","typescript"],"created_at":"2026-02-01T16:14:06.793Z","updated_at":"2026-02-01T16:14:07.566Z","avatar_url":"https://github.com/dev-rashedin.png","language":"TypeScript","readme":"# http-status-toolkit\n\n[![npm version](https://img.shields.io/npm/v/http-status-toolkit)](https://www.npmjs.com/package/http-status-toolkit)\n![typescript](https://badgen.net/badge/icon/typescript?icon=typescript\u0026label)\n[![license](https://img.shields.io/npm/l/http-status-toolkit)](https://github.com/dev-rashedin/http-status-toolkit/blob/main/LICENSE)\n[![downloads](https://img.shields.io/npm/dm/http-status-toolkit)](https://www.npmjs.com/package/http-status-toolkit)\n![bundle size](https://deno.bundlejs.com/badge?q=http-status-toolkit)\n\n\u003c!-- ![minified](https://badgen.net/bundlephobia/min/http-status-toolkit)\n![minified gzip](https://badgen.net/bundlephobia/minzip/http-status-toolkit) --\u003e\n\n\n👉 [View on npm](https://www.npmjs.com/package/http-status-toolkit)\n\nA simple and lightweight toolkit for HTTP status codes and messages — written in TypeScript for safe, reliable usage.\n\nIf you like the project, please give the project a GitHub ⭐\n\n---\n\n## What is this?\n\nThis package gives you:\n\n- HTTP status codes as constants (like `StatusCodes.OK` for 200)\n- Short and clear messages for each status code\n- Longer, more detailed messages if you want extra info\n- Localization support for 10+ languages\n- A helper function (`getStatusMessage`) to fetch messages by status code\n- Full TypeScript support for better coding experience\n\n---\n\n# 🚀 Installation Guide\n\nYou can install **http-status-toolkit** using your favorite package manager.\n\n### Using npm\n\n```bash\nnpm install http-status-toolkit\n```\n\n### Using yarn\n\n```bash\nyarn add http-status-toolkit\n```\n\n## Using pnpm\n\n```bash\npnpm add http-status-toolkit\n```\n\n## TypeScript \u0026 Module Support\n\n- ✅ Full TypeScript support with type safety and autocompletion  \n- ✅ Works in both ESM and CommonJS environments\n\n---\n\n## How to use\n\n```ts\nimport {\n  StatusCodes,\n  getStatusMessage,\n} from 'http-status-toolkit';\n\n// Get the status code number\nconsole.log(StatusCodes.OK); // 200\n\n// Get a short message (default)\nconsole.log(getStatusMessage(StatusCodes.NOT_FOUND));\n// Output: \"Not Found\"\n\n// Get a detailed message (import detailed messages and pass variant)\nimport DetailedMessages from 'http-status-toolkit/messages-detailed';\nconsole.log(getStatusMessage(StatusCodes.NOT_FOUND, { variant: DetailedMessages }));\n// Output: \"Not Found: The requested resource could not be found but may be available in the future.\"\n\n// Get a localized message (import a language variant)\nimport BengaliMessages from 'http-status-toolkit/messages-bn';\nconsole.log(getStatusMessage(StatusCodes.NOT_FOUND, { variant: BengaliMessages }));\n// Output: (Not Found message in Bengali)\n```\n\n---\n\n## What’s included?\n\n- `StatusCodes`: constants for all HTTP status codes  \n- `StatusMessages`: short messages for each code (English default)  \n- `DetailedStatusMessages`: longer, more detailed English messages  \n- `getStatusMessage(code, options?)`: returns the message for a status code; optionally pass a `{ variant }` to get localized or detailed messages  \n\n\u003e **Note:**  \n\u003e `getStatusMessage` returns the HTTP reason phrase for a status code.  \n\u003e You can also use the alias `getReasonPhrase`, which behaves the same way.\n\n---\n\n## Common HTTP Status Codes\n\n| Code | Constant     | Message          |\n| ---- | ------------ | ---------------- |\n| 200  | OK           | Request OK       |\n| 201  | CREATED      | Resource created |\n| 400  | BAD_REQUEST  | Bad input        |\n| 401  | UNAUTHORIZED | Auth required    |\n| 403  | FORBIDDEN    | Access denied    |\n| 404  | NOT_FOUND    | Not found        |\n| 500  | SERVER_ERROR | Server crashed   |\n\n\n🔗 **[See full list of status codes](./docs/default-status-messages.md)**  \n🔗 **[See status codes with detailed messages](./docs/detailed-status-messages.md)**\n\n---\n\n## Supported Languages (Localization)\n\nYou can import message variants for different languages:\n\n| Language    | Import Path                           | Docs File                          |\n|-------------|-------------------------------------|-----------------------------------|\n| English (default)  | —                               | —                                 |\n| Detailed English   | `messages-detailed`              | [detailed-status-messages.md](./docs/detailed-status-messages.md) |\n| Bengali     | `messages-bn`                       | [bengali-status-messages.md](./docs/bengali-status-messages.md)   |\n| Chinese     | `messages-zh`                       | [chinese-status-messages.md](./docs/chinese-status-messages.md)   |\n| Hindi       | `messages-hi`                       | [hindi-status-messages.md](./docs/hindi-status-messages.md)       |\n| Arabic      | `messages-ar`                       | [arabic-status-messages.md](./docs/arabic-status-messages.md)     |\n| German      | `messages-de`                       | [german-status-messages.md](./docs/german-status-messages.md)     |\n| French      | `messages-fr`                       | [french-status-messages.md](./docs/french-status-messages.md)     |\n| Italian     | `messages-it`                       | [italian-status-messages.md](./docs/italian-status-messages.md)   |\n| Spanish     | `messages-es`                       | [spanish-status-messages.md](./docs/spanish-status-messages.md)   |\n| Japanese    | `messages-ja`                       | [japanese-status-messages.md](./docs/japanese-status-messages.md) |\n| Russian     | `messages-ru`                       | [russian-status-messages.md](./docs/russian-status-messages.md)   |\n\n---\n\n## Contributors\n\nThanks to everyone who has contributed to this project! Special thanks to:\n\n- [Rocky Haque](https://github.com/rockyhaque) — for their valuable pull request(s)\n\nContributions of any kind are always welcome. Feel free to open issues or submit PRs!\n\n---\n\n## License\n\nMIT License. See the LICENSE file.\n\n---\n\n## Contributions\n\nFeel free to suggest improvements or add new status codes by opening issues or pull requests on GitHub.\n\n---\n\n## Links\n\n- **GitHub:** [https://github.com/dev-rashedin/http-status-toolkit](https://github.com/dev-rashedin/http-status-toolkit)  \n- **Portfolio:** [https://www.rashedin.dev](https://www.rashedin.dev)\n\n---\n\nMade with ❤️ by [Rashedin Islam](https://www.rashedin.dev)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-rashedin%2Fhttp-status-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdev-rashedin%2Fhttp-status-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdev-rashedin%2Fhttp-status-toolkit/lists"}