{"id":15362889,"url":"https://github.com/ngot/fibjs-statuses","last_synced_at":"2025-08-09T23:36:50.153Z","repository":{"id":73524300,"uuid":"46205298","full_name":"ngot/fibjs-statuses","owner":"ngot","description":null,"archived":false,"fork":false,"pushed_at":"2015-11-15T14:06:20.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-02T20:28:19.278Z","etag":null,"topics":[],"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/ngot.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}},"created_at":"2015-11-15T05:10:10.000Z","updated_at":"2015-11-15T12:50:58.000Z","dependencies_parsed_at":"2023-03-11T15:29:47.423Z","dependency_job_id":null,"html_url":"https://github.com/ngot/fibjs-statuses","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ngot/fibjs-statuses","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngot%2Ffibjs-statuses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngot%2Ffibjs-statuses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngot%2Ffibjs-statuses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngot%2Ffibjs-statuses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ngot","download_url":"https://codeload.github.com/ngot/fibjs-statuses/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ngot%2Ffibjs-statuses/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269654073,"owners_count":24454318,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-01T13:04:08.561Z","updated_at":"2025-08-09T23:36:50.135Z","avatar_url":"https://github.com/ngot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Statuses\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nHTTP status utility for node.\n\n## API\n\n```js\nvar status = require('statuses');\n```\n\n### var code = status(Integer || String)\n\nIf `Integer` or `String` is a valid HTTP code or status message, then the appropriate `code` will be returned. Otherwise, an error will be thrown.\n\n```js\nstatus(403) // =\u003e 403\nstatus('403') // =\u003e 403\nstatus('forbidden') // =\u003e 403\nstatus('Forbidden') // =\u003e 403\nstatus(306) // throws, as it's not supported by node.js\n```\n\n### status.codes\n\nReturns an array of all the status codes as `Integer`s.\n\n### var msg = status[code]\n\nMap of `code` to `status message`. `undefined` for invalid `code`s.\n\n```js\nstatus[404] // =\u003e 'Not Found'\n```\n\n### var code = status[msg]\n\nMap of `status message` to `code`. `msg` can either be title-cased or lower-cased. `undefined` for invalid `status message`s.\n\n```js\nstatus['not found'] // =\u003e 404\nstatus['Not Found'] // =\u003e 404\n```\n\n### status.redirect[code]\n\nReturns `true` if a status code is a valid redirect status.\n\n```js\nstatus.redirect[200] // =\u003e undefined\nstatus.redirect[301] // =\u003e true\n```\n\n### status.empty[code]\n\nReturns `true` if a status code expects an empty body.\n\n```js\nstatus.empty[200] // =\u003e undefined\nstatus.empty[204] // =\u003e true\nstatus.empty[304] // =\u003e true\n```\n\n### status.retry[code]\n\nReturns `true` if you should retry the rest.\n\n```js\nstatus.retry[501] // =\u003e undefined\nstatus.retry[503] // =\u003e true\n```\n\n### statuses/codes.json\n\n```js\nvar codes = require('statuses/codes.json');\n```\n\nThis is a JSON file of the status codes\ntaken from `require('http').STATUS_CODES`.\nThis is saved so that codes are consistent even in older node.js versions.\nFor example, `308` will be added in v0.12.\n\n## Adding Status Codes\n\nThe status codes are primarily sourced from http://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv.\nAdditionally, custom codes are added from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes.\nThese are added manually in the `lib/*.json` files.\nIf you would like to add a status code, add it to the appropriate JSON file.\n\nTo rebuild `codes.json`, run the following:\n\n```bash\n# update src/iana.json\nnpm run update\n# build codes.json\nnpm run build\n```\n\n[npm-image]: https://img.shields.io/npm/v/statuses.svg?style=flat\n[npm-url]: https://npmjs.org/package/statuses\n[node-version-image]: http://img.shields.io/badge/node.js-%3E%3D_0.6-brightgreen.svg?style=flat\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/jshttp/statuses.svg?style=flat\n[travis-url]: https://travis-ci.org/jshttp/statuses\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/statuses.svg?style=flat\n[coveralls-url]: https://coveralls.io/r/jshttp/statuses?branch=master\n[downloads-image]: http://img.shields.io/npm/dm/statuses.svg?style=flat\n[downloads-url]: https://npmjs.org/package/statuses\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngot%2Ffibjs-statuses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fngot%2Ffibjs-statuses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fngot%2Ffibjs-statuses/lists"}