https://github.com/sindresorhus/node-status-codes
Node.js `http.STATUS_CODES` ponyfill
https://github.com/sindresorhus/node-status-codes
Last synced: 9 months ago
JSON representation
Node.js `http.STATUS_CODES` ponyfill
- Host: GitHub
- URL: https://github.com/sindresorhus/node-status-codes
- Owner: sindresorhus
- License: mit
- Created: 2015-07-26T22:55:43.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T15:53:13.000Z (over 2 years ago)
- Last Synced: 2025-04-19T20:12:06.736Z (10 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 34
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
- Security: .github/security.md
Awesome Lists containing this project
- awesome-nodejs-precise - node-status-codes - status-codes .svg?style=social&label=Star&maxAge=2592000?style=flat-square)]() | Node.js <code>http.STATUS_CODES</code> ponyfill. | (Packages / Polyfills Node.js)
- awesome-nodejs-cn - node-status-codes - Node.js `http.STATUS_CODES` ponyfill. (Number / Polyfills)
README
# Deprecated
This package is no longer relevant. The `http.STATUS_CODES` property is stable now.
---
# node-status-codes [](https://travis-ci.org/sindresorhus/node-status-codes)
> Node.js [`http.STATUS_CODES`](https://nodejs.org/api/http.html#http_http_status_codes) [ponyfill](https://ponyfill.com)
The built-in list of HTTP status codes [differ](https://github.com/nodejs/node/commit/8be6060020) between Node.js versions, so this is a good way to make sure it's consistent. Will be kept up to date with latest Node.js.
## Install
```
$ npm install --save node-status-codes
```
## Usage
```js
var nodeStatusCodes = require('node-status-codes');
console.log(nodeStatusCodes[200]);
//=> 'OK'
console.log(nodeStatusCodes[500]);
//=> 'Internal Server Error'
```
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)