{"id":19019373,"url":"https://github.com/jshttp/statuses","last_synced_at":"2025-05-14T02:08:40.371Z","repository":{"id":14965416,"uuid":"17690272","full_name":"jshttp/statuses","owner":"jshttp","description":"HTTP status utility","archived":false,"fork":false,"pushed_at":"2025-02-13T08:39:26.000Z","size":135,"stargazers_count":277,"open_issues_count":2,"forks_count":29,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-05-12T11:06:59.367Z","etag":null,"topics":["http","javascript","nodejs","status-codes"],"latest_commit_sha":null,"homepage":null,"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/jshttp.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.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},"funding":{"open_collective":"express"}},"created_at":"2014-03-13T01:20:40.000Z","updated_at":"2025-05-07T06:29:30.000Z","dependencies_parsed_at":"2024-04-30T16:43:45.704Z","dependency_job_id":"cbb55605-cae7-495e-854d-5a07687399d5","html_url":"https://github.com/jshttp/statuses","commit_stats":{"total_commits":289,"total_committers":11,"mean_commits":"26.272727272727273","dds":"0.11072664359861595","last_synced_commit":"7d0c3abbf9a5326d8678c15bafcb3284940458e9"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Fstatuses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Fstatuses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Fstatuses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jshttp%2Fstatuses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jshttp","download_url":"https://codeload.github.com/jshttp/statuses/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253984136,"owners_count":21994777,"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","javascript","nodejs","status-codes"],"created_at":"2024-11-08T20:12:08.544Z","updated_at":"2025-05-14T02:08:35.361Z","avatar_url":"https://github.com/jshttp.png","language":"JavaScript","readme":"# statuses\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][ci-image]][ci-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n[![OpenSSF Scorecard Badge][ossf-scorecard-badge]][ossf-scorecard-visualizer]\n\nHTTP status utility for node.\n\nThis module provides a list of status codes and messages sourced from\na few different projects:\n\n  * The [IANA Status Code Registry](https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml)\n  * The [Node.js project](https://nodejs.org/)\n  * The [NGINX project](https://www.nginx.com/)\n  * The [Apache HTTP Server project](https://httpd.apache.org/)\n\n## Installation\n\nThis is a [Node.js](https://nodejs.org/en/) module available through the\n[npm registry](https://www.npmjs.com/). Installation is done using the\n[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):\n\n```sh\n$ npm install statuses\n```\n\n## API\n\n\u003c!-- eslint-disable no-unused-vars --\u003e\n\n```js\nvar status = require('statuses')\n```\n\n### status(code)\n\nReturns the status message string for a known HTTP status code. The code\nmay be a number or a string. An error is thrown for an unknown status code.\n\n\u003c!-- eslint-disable no-undef --\u003e\n\n```js\nstatus(403) // =\u003e 'Forbidden'\nstatus('403') // =\u003e 'Forbidden'\nstatus(306) // throws\n```\n\n### status(msg)\n\nReturns the numeric status code for a known HTTP status message. The message\nis case-insensitive. An error is thrown for an unknown status message.\n\n\u003c!-- eslint-disable no-undef --\u003e\n\n```js\nstatus('forbidden') // =\u003e 403\nstatus('Forbidden') // =\u003e 403\nstatus('foo') // throws\n```\n\n### status.codes\n\nReturns an array of all the status codes as `Integer`s.\n\n### status.code[msg]\n\nReturns the numeric status code for a known status message (in lower-case),\notherwise `undefined`.\n\n\u003c!-- eslint-disable no-undef, no-unused-expressions --\u003e\n\n```js\nstatus['not found'] // =\u003e 404\n```\n\n### status.empty[code]\n\nReturns `true` if a status code expects an empty body.\n\n\u003c!-- eslint-disable no-undef, no-unused-expressions --\u003e\n\n```js\nstatus.empty[200] // =\u003e undefined\nstatus.empty[204] // =\u003e true\nstatus.empty[304] // =\u003e true\n```\n\n### status.message[code]\n\nReturns the string message for a known numeric status code, otherwise\n`undefined`. This object is the same format as the\n[Node.js http module `http.STATUS_CODES`](https://nodejs.org/dist/latest/docs/api/http.html#http_http_status_codes).\n\n\u003c!-- eslint-disable no-undef, no-unused-expressions --\u003e\n\n```js\nstatus.message[404] // =\u003e 'Not Found'\n```\n\n### status.redirect[code]\n\nReturns `true` if a status code is a valid redirect status.\n\n\u003c!-- eslint-disable no-undef, no-unused-expressions --\u003e\n\n```js\nstatus.redirect[200] // =\u003e undefined\nstatus.redirect[301] // =\u003e true\n```\n\n### status.retry[code]\n\nReturns `true` if you should retry the rest.\n\n\u003c!-- eslint-disable no-undef, no-unused-expressions --\u003e\n\n```js\nstatus.retry[501] // =\u003e undefined\nstatus.retry[503] // =\u003e true\n```\n\n## License\n\n[MIT](LICENSE)\n\n[ci-image]: https://badgen.net/github/checks/jshttp/statuses/master?label=ci\n[ci-url]: https://github.com/jshttp/statuses/actions?query=workflow%3Aci\n[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/statuses/master\n[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master\n[node-version-image]: https://badgen.net/npm/node/statuses\n[node-version-url]: https://nodejs.org/en/download\n[npm-downloads-image]: https://badgen.net/npm/dm/statuses\n[npm-url]: https://npmjs.org/package/statuses\n[npm-version-image]: https://badgen.net/npm/v/statuses\n[ossf-scorecard-badge]: https://api.securityscorecards.dev/projects/github.com/jshttp/statuses/badge\n[ossf-scorecard-visualizer]: https://kooltheba.github.io/openssf-scorecard-api-visualizer/#/projects/github.com/jshttp/statuses\n","funding_links":["https://opencollective.com/express"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshttp%2Fstatuses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjshttp%2Fstatuses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjshttp%2Fstatuses/lists"}