{"id":20333061,"url":"https://github.com/jaebradley/http-status-identifier","last_synced_at":"2025-03-04T12:44:51.204Z","repository":{"id":19728406,"uuid":"87490499","full_name":"jaebradley/http-status-identifier","owner":"jaebradley","description":"🤔  What's my HTTP status?","archived":false,"fork":false,"pushed_at":"2023-04-18T09:35:34.000Z","size":5019,"stargazers_count":0,"open_issues_count":9,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-03T17:17:46.429Z","etag":null,"topics":["http","nodejs","npm","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/http-status-identifier","language":"JavaScript","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/jaebradley.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":"2017-04-07T01:17:57.000Z","updated_at":"2020-06-02T14:53:56.000Z","dependencies_parsed_at":"2024-11-14T20:41:58.427Z","dependency_job_id":null,"html_url":"https://github.com/jaebradley/http-status-identifier","commit_stats":null,"previous_names":["jaebradley/http-status-code-definition-identifier"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fhttp-status-identifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fhttp-status-identifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fhttp-status-identifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaebradley%2Fhttp-status-identifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaebradley","download_url":"https://codeload.github.com/jaebradley/http-status-identifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241705908,"owners_count":20006398,"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","nodejs","npm","npm-package"],"created_at":"2024-11-14T20:29:12.601Z","updated_at":"2025-03-04T12:44:51.085Z","avatar_url":"https://github.com/jaebradley.png","language":"JavaScript","readme":"# HTTP Status Identifier\n\n[![Greenkeeper badge](https://badges.greenkeeper.io/jaebradley/http-status-identifier.svg)](https://greenkeeper.io/)\n[![Build Status](https://travis-ci.org/jaebradley/http-status-identifier.svg?branch=master)](https://travis-ci.org/jaebradley/http-status-identifier)\n[![codecov](https://codecov.io/gh/jaebradley/http-status-identifier/branch/master/graph/badge.svg)](https://codecov.io/gh/jaebradley/http-status-identifier)\n[![npm version](https://badge.fury.io/js/http-status-identifier.svg)](https://badge.fury.io/js/http-status-identifier)\n[![npm](https://img.shields.io/npm/dt/http-status-identifier.svg)](https://www.npmjs.com/package/http-status-identifier)\n\n## Purpose\n\nA simple Node JS client that returns an [HTTP Status](https://github.com/jaebradley/http-status-identifier/blob/master/src/data/HttpStatus.js), wrapped in a Promise, given either a status code (i.e `200`) or the status name (i.e `I'm a teapot`).\n\nIt also returns an [HTTP Status Family](https://github.com/jaebradley/http-status-identifier/blob/master/src/data/HttpStatusFamily.js) (`INFORMATIONAL` or `1xx`, `SUCCESS` or `2xx`, `REDIRECTION` or `3xx`, `CLIENT ERROR` or `4xx`, `SERVER ERROR` or `5xx`) given a status family name or a specific HTTP Status.\n\n## Installation\n\nInstall via [NPM](https://www.npmjs.com/package/http-status-identifier).\n```\nnpm install http-status-identifier\n```\n\n## API\n\n### HTTP Statuses\n\nTo retrieve HTTP statuses use the `identifyStatus` method.\n\nThe `identifyStatus` method expects either\n1. an HTTP status code, represented as a `string` or a `number`\n2. an HTTP status name, represented as a `string`\n\nThe returned [`HttpStatus`](https://github.com/jaebradley/http-status-code-definition-identifier/blob/master/src/data/HttpStatus.js) object contains the following fields:\n* `name`: A `string` which represents the name for the HTTP status\n* `code`: A `number` which represents the code for the HTTP status\n* `description`: A `string` that provides a brief overview of the HTTP status\n* `supplementaryInformation`: A `string` that provides additional information for the HTTP status. This field may be empty where additional information is not necessary.\n* `documentationUrl`: A `string` that represents the URL where official documentation for the HTTP status is found. This is often a URL to RFC documentation.\n\n#### Example\n\n```javascript\nimport { identifyStatus } from 'http-status-identifier';\n\n// Returns HttpStatus.OK\nconst okHttpStatus = identifyStatus(200);\n\n// Returns HttpStatus.IM_A_TEAPOT\nconst imATeapotHttpStatus = identifyStatus(\"I'm a teapot\");\n\n// Returns HttpStatus.BAD_REQUEST\nconst badRequestHttpStatus = identifyStatus('400');\n```\n\n### HTTP Status Families\n\nTo retrieve the HTTP Family for a given status use the `identifyFamily` method.\n\nThe `identifyFamily` method expects either\n1. an HTTP status code, represented as a `string` or a `number`\n2. an HTTP status name, represented as a `string`\n\n#### Example\n\n```javascript\nimport { identifyFamily } from 'http-status-identifier';\n\n// Returns HttpStatusFamily.SUCCESS\nconst successFamily = identifyFamily('sUcCesS');\n\n// Returns HttpStatusFamily.SUCCESS\nconst successFamilyAgain = identifyFamily(200);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fhttp-status-identifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaebradley%2Fhttp-status-identifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaebradley%2Fhttp-status-identifier/lists"}